The French Defence Ministry said the captors of a military agent killed him during a French commando raid in Somalia.
The ministry said 17 Islamists and two French commandos also died in the fighting.
Gen Martin Klotz, a spokesman for the ministry, declined to provide details of the overnight operation aimed at rescuing fellow DGSE spy service agent Denis Allex – the code-name for the agent who had been held hostage in Somalia since 2009.
Mr Allex was kidnapped from a hotel in Mogadishu on July 14 2009 with a colleague who later escaped.
They were in Somalia to train government forces, which are fighting Islamist militiamen.
The raid occurred in the town of Bulomarer, and comes on the heels of French military intervention in Mali to help the country against al-Qaida-linked militants.