TV grab of footage shows Denis Allex, a French hostage allegedly held by Somali militants, 12 January 2013.

Story highlights

Somali Islamists claim the killing was revenge for a French military raid Friday

The French government believes the hostage died during its rescue attempt

Al-Shabaab quickly claimed after the mission that it had kept Denis Allex alive

The Islamists accused France of killing Muslims around the world

Islamist militants had been saving one last blow to deal to France after its military conducted a bloody, unsuccessful hostage rescue attempt in Somalia Friday.

Al-Shabaab declared Wednesday that it has killed the hostage. In the war of words, it was important to the militia to announce the killing occurred not during but after the raid – as retribution for it.

Read more: 2 French soldiers likely killed in failed hostage rescue, defense minister says

The French defense ministry has said it believed the militant group killed military agent Denis Allex during Friday’s intense firefight thus thwarting the operation’s objective on the spot.

The al Qaeda affiliate claimed soon after the raid that it had moved Allex unharmed to a new location and would decide his fate shortly afterward in light of France’s deadly military operation.

Read more: U.S. supported France’s failed hostage rescue in Somalia

Allex was an agent of the DGSE, France’s equivalent of the CIA and a part of its defense ministry.

In the long statement on its decision to take his life, al-Shabaab accused the French soldiers of killing Muslims in military operations abroad and mistreating them at home. It mentioned France’s current role in Mali, where 1,700 troops are to join forces with neighboring African countries to rout out an Islamist occupation of the country’s north.

All of this in sum warranted Allex’ killing as an act of vengeance, al-Shabaab said.

Read more: French bid to rescue hostage in Somalia fails, leading to soldier’s death

At least 17 al-Shabaab fighters and two French soldiers died in Friday’s mission in the village of Bulo-Marer, about 75 miles (120 kilometers) northwest of Mogadishu.

The French defense ministry originally reported one of the two soldiers as missing, but al-Shabaab later posted a photo of his purported corpse to its Twitter feed, saying he had died of wounds suffered during the heated battle that ensued during Friday’s operation.

Allex was abducted on July 14, 2009, while on a mission in Mogadishu in support of the transitional Somali government, the French Defense Ministry said. French media reports suggest that Denis Allex is a pseudonym for the military serviceman.

French officials said they launched the rescue attempt after the terror group failed to negotiate for the hostage’s release for years while holding him in inhumane conditions.

On Monday, French Defense Dinister Jean-Yves le Drian said the failure of the rescue mission was “extremely regrettable.”

CNN’s Saad Abedine contributed to this report