Police tactical units arrived by helicopter as the hostage situation unfolded at the Conde-sur-Sarthe Penitentiary Centre, which holds dangerous or radicalised prisoners and those with serious discipline problems.
The prisoner, armed with the improvised weapon, had taken the guard and the female trainee hostage during meal time, officials said.
The guard was released first and then the female trainee was also freed, both “safe and sound”, before the prisoner surrendered, the national Prison Administration Directorate said.
No further details were immediately available about how the guards were freed or whether it involved a negotiation.
A justice ministry source said the inmate has a history of psychiatric problems and hostage taking. He has convictions for robbery, rape and for the murder of a prison cellmate.
Elite police units had arrived at the prison by three helicopters, an AFP photographer at the scene said.
Security measures were increased in Conde-sur-Sarthe after a prisoner stabbed two guards with a homemade knife in March. After failed negotiations to end a standoff, security units launched an assault, wounding the prisoner.