Freed were four others, one of which is a three year-old child.
The pirates have demanded $2 million for the release of the hostages.
The military made its move after the pirates refused their offers, including one to swap an officer for the mother and child held aboard, and threatened to execute the hostages one-by-one -- and because the Tanit was drifting closer to the Somalian coast, the defense ministry said.
The possibility that the pirates could take their hostages ashore was a red line that prompted the mission. The same red line triggered two successful rescue missions by the French military last year, the ministry said.
According to French media reports, a special forces unit attacked the hijacked vessel from different directions in two motor-powered rubber boats. The pirates opened fire and the special forces team fired back.
Two of the five pirates were killed, along with Florent Lemacon, the owner of the Tanit, French media said. The military rescued Lemacon's wife and 3-year-old child along with two friends of the Lemacons.
Standing by the commando-style tactics, the French president Nicolas Sarkozy's office confirmed "France's determination not to give into blackmail, and to defeat the pirates".
However, Morin later said that, in a break with usual French policy, a ransom had been offered to the pirates, who hijacked the Tanit last weekend as it sailed towards Zanzibar. He said Sarkozy had given the order to attack after negotiations had broken down and the pirates threatened to execute the hostages.
"Of course we offered all we could offer ... we even offered them a ransom," said Morin, declining to name the sum proposed. "All these things were permanently and consistently refused." He said France had also suggested "exchanging" Colin, the child, and his mother, Chloe, for an officer, but that had also been rejected.
This highlights the difficulties with any option that will be chosen in dealing with pirates. Rescue operations are a risk, but the only other option is to hand the pirates what they ask for and hope they release the hostages.