Somali pirates attempted to storm the French navy's 18,000 tonne Indian Ocean fleet flagship after mistaking it for a cargo vessel, the military said.
The crew of La Somme, a 160-metre (525-foot) command vessel and fuel tanker, easily saw off the brazen night-time assault by lightly armed fighters on two open-topped motorboats and captured five pirates, a spokesman said.
"The pirates, who because of the darkness took the French ship for a commercial vessel, were on board two vessels and opened fire with Kalashnikovs," Admiral Christophe Prazuck said.
La Somme is the French command vessel in the Indian Ocean, overseeing French air, sea and land forces fighting Somali pirates and hunting terrorists under the banner of the US-led Operation Enduring Freedom.
Officers on the ship have directed commando operations to free French hostages in the hands of Somali pirates.
The pirates tried to flee when they realised their mistake but were pursued by French forces who, after an hour-long chase, caught one of the skiffs, Prazuck said.
On it they found five men but no weapons, water or food as the pirates had apparently thrown all of the boat's contents overboard, the spokesman said.
The world's naval powers have deployed dozens of warships to the lawless waters off Somalia over the past year to curb attacks by pirates in one of the world's busiest maritime trade routes. PTI