* France tried to rescue hostage on Saturday
* Rebels say killing was to avenge Mali offensive
* Execution carried out on Jan. 16, rebels say
By Feisal Omar
MOGADISHU, Jan 17 (Reuters) - Somali militants linked to al Qaeda said on Thursday they had executed a French agent who French commandos had tried but failed to rescue at the weekend.
Al Shabaab rebels have said the death sentence imposed on Denis Allex was to avenge what it called France's growing persecution of Muslims and its military operations around the world against Islamists, including in Mali.
The kidnapping of dozens of hostages at a gas plant in Algeria by Islamist fighters on Wednesday and al Shabaab's execution claim illustrate the fallout from Mali's war against loosely allied bands of al Qaeda-inspired rebels in Africa and beyond.
"Let Muslims enjoy his execution and the French cry," Sheikh Abdiasis Abu Musab, al Shabaab's spokesman for military operations, told Reuters by telephone.
The militants said Allex, held hostage since mid 2009, had been killed at 16:30 GMT on Wednesday.
France's line has been that Allex was killed in Saturday's failed rescue mission when helicopter-borne French troops swooped into southern Somalia under the cover of darkness.
The raid, in which two French commandos were killed, coincided with the launch of French air strikes against Ismalist rebels in Mali in West Africa.
The Paris government had been concerned the lives of various French hostages held in Africa would be at risk if it intervened militarily against the al Qaeda-aligned combatants in Mali, but said on Saturday the two military operations were not connected.
Al Shabaab's decision to kill Allex had been unanimous, it said on Wednesday, in light of France's military operations in Afghanistan and Mali and support for "African invaders in Muslim lands".
SPIES
Troops from Uganda, Burundi, Kenya and Ethiopia are battling al Shabaab on several fronts in Somalia and have forced the rebels to give up significant territory in southern and central areas of the Horn of Africa country.
The militants, who formally merged with al Qaeda in February last year, launched their campaign against the government in early 2007, seeking to impose sharia, or Islamic law, on the entire country.
Allex was one of two officers from the DGSE intelligence agency kidnapped by al Shabaab in Mogadishu in July 2009. His colleague, Marc Aubriere, escaped a month later but Allex had been held ever since.
After Allex's abduction, al Shabaab issued a string of demands. These included an end to French support for the Somali government and a withdrawal of the 17,600-strong African peacekeeping force propping up the U.N.-backed administration.
In October, the militants uploaded a video of Allex pleading with French President Francois Hollande to negotiate his release and save his life.
There was no immediate comment from France after al Shabaab's statement it had carried out the execution.
Hollande said on Wednesday he took responsibility for the failed rescue of Allex. He said, however, he stood by the operation because it sent out a message France could not accept its nationals being taken hostage.