Updated 8:36 PM ET
MOGADISHU, Somalia A raid to free a French intelligence agent held captive in Somalia for three years went horribly wrong, leaving 17 Islamists and at least one French commando dead in a mud-caked farming town deep in militant territory.
In the chaotic aftermath of the firefight, the hostage's fate was unclear Saturday. The Islamists denied French claims that he was killed and said they had a new prisoner a wounded French soldier.
The botched rescue in East Africa came the same day French airstrikes in the West African nation of Mali targeted resurgent rebel Islamists. French officials said the two operations were unrelated, but stepped up domestic counter-terror measures to protect public places and transportation networks.
Confusion surrounded early reports of the failed rescue of the French agent, known by his code-name Denis Allex. He was captured in Somalia on July 14, 2009 Bastille Day and last seen in a video released in October pleading for the French president to help him.
But it was clear that a dangerous raid the French defense minister said was planned with the utmost of care had encountered serious problems from the moment the helicopters swooped in.
"This operation could not be achieved despite the sacrifice of two of our soldiers and doubtless the murder of our hostage," French President Francois Hollande said in a grim nationwide broadcast. "But this operation confirms the determination of France not to give into blackmail by terrorists."
French Defense Minister Jean-Yves Le Drian said Allex was killed by his captors and that one French soldier was missing and one dead, along with 17 Islamists. The Defense Ministry earlier said two commandos were killed in the fighting in the Somali town of Bulomarer, a small farming community under Islamist control for four years.
"It was an extremely dangerous mission," Le Drian said. "Everything indicates Denis Allex was killed."
The militant Islamist group al-Shabab, which held Allex for more than three years, said Saturday that he remained alive and in its custody, as was a new captive a French commando wounded in fighting. There are also seven French hostages in Mali.
Residents of Bulomarer described hearing explosions and gunfire from what they called an al-Shabab base. An al-Shabab official said that fighting began after helicopters dropped off French soldiers.
"Five helicopters attacked a house in the town. They dropped soldiers off on the ground so that they could reach their destination," he said on condition of anonymity because he was not authorized to speak to the media.
The French attack was swift and loud, residents said.
"We heard a series of explosions followed by gunfire just seconds after a helicopter flew over the town," Mohamed Ali, a resident of Bulomarer, told The Associated Press by telephone. "We don't know exactly what happened, but the place was an al-Shabab base and checkpoint."
An elder in the town, Hussein Yasin, said the French troops shot dead two residents who turned on flashlights after hearing movement. As the soldiers walked away, they encountered an al-Shabab checkpoint and the gunfire began.
As the Islamists retreated, the helicopters returned to retrieve the commandos, he said.
The al-Shabab official said some soldiers were killed, but the group held only one dead French soldier. Later, the Islamist group released a statement saying that Allex "remains safe and far from the location of the battle." It said there would be a verdict in his case in two days.
The chief of staff of the French army, Edouard Guillaud, said France had exhausted any other way to free Allex.
"When you get to the point of launching an assault, it means the other options had failed," Guillaud said.
Allex was kidnapped from a hotel in Mogadishu, Somalia, on July 14, 2009 with a colleague who later escaped. They were in Somalia to train government forces, which are fighting Islamist militiamen.
In October, Hollande pledged to "use all means" to contact "anyone who can help free our hostages."
In 2009, a Frenchman held hostage by pirates off the Somali coast was killed in the crossfire during a commando rescue on his captive sailboat. The man's family was rescued.
And in 2011, two French hostages kidnapped in Niger were killed by their captors as French troops closed in for a rescue.