NAIROBI – A Somali Islamist group has handed over one of two French hostages to al Qaeda-linked al Shabaab militants to avoid clashes between the two insurgent bands, rebels and officials said on Thursday.

Gunmen from an Islamist faction within President Sheikh Sharif Ahmed's security forces seized the two in a Mogadishu hotel on Tuesday, then handed them to Hizbul Islam insurgents.

But al Shabaab -- which is also fighting the Somali government -- demanded that Hizbul Islam give the French security men to them.

We shared the two men to avoid clashes between Islamists, an al Shabaab official told Reuters by telephone.

Senior police officer Abdiqadir Odweyne and another high-ranking official confirmed Hizbul Islam had handed over the senior of the two French security officials.

Western security services view al Shabaab as a proxy for Osama bin Laden's al Qaeda network in the failed Horn of Africa state, which has been mired in conflict since 1991.

The higher ranking French official was taken by al Shaabab and the other remained with (Sheikh Hassan) Dahir Aweys, Odweyne said, referring to the head of Hizbul Islam.

Earlier in the day, al Shabaab fighters had surrounded Aweys' house, where the two Frenchmen were being held, and threatened to storm it, witnesses said.

BARGAINING CHIPS

A Somali government official and some media had said the two kidnapped Frenchmen were posing as journalists. Paris has denied that, saying they were on official government business.

Somalia's security forces are deeply divided and some actively support the insurgents, who are fighting government troops on a daily basis.

Mogadishu is one of the world's most dangerous cities and has a history of kidnappings of foreigners, mainly aid workers and journalists. Hostages have normally been released after days or weeks in captivity for substantial ransom payments.

A Somali analyst said the French government may secure the release of its men if it adopts a soft approach and is willing to part with a ransom big enough to keep financing the war.

The Shabaab are not thinking about killing, they may have other options, independent analyst Hassan Hundubey said.

They may demand the release of one of their leaders in Guantanamo or demand a ransom, since they want to run this war indefinitely. His life is more important than a beheading.

Hundubey said a Somali linked to the Islamists was being held at a U.S. military prison in Guantanamo for working with al Qaeda. The hardline al Shabaab has beheaded Somalis in the past for allegedly spying for the government and western nations.

They killed the Somalis because they were sending a message to other Somalis who might want to cooperate with western security agencies or the government, Hundubey said.