Somalia security forces on Wednesday freed eight sailors who had been taken ashore by pirates after they were chased off a hijacked Indian ship earlier this week, a coast guard official said.
"The eight hostages were freed without fighting. The security forces overwhelmingly besieged them and the pirates tried to flee, but three of them were captured," Abdirashid Mohamed Ahmed, deputy commander of the maritime force in Somalia's Galmudug state said.
Pirates stormed the "Al Kausar" ship off the Indian Ocean coast near Yemen on March 31, holding the 10-man crew hostage and making ransom demands.
Somali security forces liberated the vessel on Monday, rescuing two Indian crew members, but the pirates were able to escape with the rest of the hostages during an exchange of gunfire.
Ahmed said the newly freed crew members were "safe and healthy."
The Al Kausar, which was transporting cargo including wheat and sugar from Dubai via Yemen to Somalia's Bossaso port, was the third vessel hijacked in the space of less than a month off the coast of the East African nation.
Experts have warned that shipping companies have let down their guard after the piracy crisis reached its height five years ago.
Somali pirates began attacking ships in 2005, disrupting a major shipping route in the Red Sea and costing the global economy billions of dollars.
At the peak of the piracy crisis in January 2011, 32 boats and 736 hostages were held.
Though anti-piracy measures ended attacks on commercial vessels, fishing boats have continued to face attacks sporadically.
However on March 13, pirates seized the Aris 13 oil tanker and eight Sri Lankan hostages in the first attack on a large merchant vessel by Somali pirates since 2012.
The pirates say they are reacting to illegal fishing off their coast, which has long been seen as the major driver of piracy in the country.
Though the pirates have held some hostages for as long as five years, they released the Aris 13 and its crew just four days after its seizure.