'Spying and conspiracy'

The French foreign ministry denied the reports saying: "His release took place without violence, contrary to certain suggestions made locally."

The fate of the second man was unclear as they had been split up after being taken from the hotel.

In depth


 Profile: Sharif Ahmed
Timeline: Somalia
 Inside Story: What next for Somalia
 Video: Foreign fighters 'invade' Somalia
 Video: US 'fears collapse' of Mogadishu government
 Riz Khan: Somalia - From bad to worse
Restoring Somalia
A long road to stability
Al-Shabab: Somali fighters undeterred
 Somalia at a crossroads

One was handed over to the al-Shabab movement, which has vowed to overthrow the government, and the other was given to members of the allied Hizb ul-Islam.

The French agents were in the country to train Somali government forces and the armed opposition movments had threatened to put them on trial for spying and conspiracy against Islam.

Local media reported at the time of the abduction that the pair had been posing as journalists.

Kidnappings are common in Somalia and captives are often released after the payment of substantial ransoms.

However, the French foreign ministry said that "officially, France does not pay ransoms".

The government of Sharif Ahmed, the president, controls only small parts of the country's central region and a few districts of Mogadishu.

He called on the armed opposition to observe a ceasefire during the Muslim holy month of Ramadan which started last week, but they have dismissed the call, saying the president is planning to use any truce to rearm his forces.