The 27-year-old inmate, considered a “radicalised” Islamist, attacked prison staff while shouting “Allahu Akhbar” (God is Greatest), prison staff representative Alassanne Sall told AFP.
He then retreated into a room with his wife who was visiting him at the high-security facility in Conde-sur-Sarthe in Normandy, the justice ministry said in a statement.
“It was truly a murder attempt. There was blood everywhere. The family-visiting unit was a battle scene,” said Sall, from the Force Ouvriere trade union.
One of the guards suffered a serious chest wound, while the second was slashed on the face and back, he added.
The attack took place in the family unit where the prisoner, who is serving a 30-year sentence for kidnapping leading to a death, armed robbery and condoning terrorism, was being visited by his wife.
Police reinforcements have been rushed to the prison, the justice ministry said.
Specialised anti-terror magistrates in Paris said they were investigating the case, meaning it was being treated as a terror incident.
France has suffered a series of attacks from Islamic extremists since 2015 and is on high alert amid concerns about the return of Islamic State jihadists from Syria.