Militia loyal to Somalia's Islamic courts have stormed and recaptured a ship hijacked by pirates off the Somali coast, regional maritime officials say.
Somalia's coastline has been notorious for piracy
Six of the pirates were captured after a gun battle and all 14 crew members are reported to be unharmed.
The charcoal-carrying freight vessel, seized a week ago, was being held for a $1m (£524,000) ransom.
Somalia's coastline is notorious for piracy, but incidents have declined since the Islamists took power in June.
The Union of Islamic Courts (UIC) has promised to restore law and order in the territory it controls.
A Kenyan official said the ship - the Veesham One, registered in the United Arab Emirates - was being taken to the Somali capital, Mogadishu.
Ten Somali pirates were sentenced in Kenya to seven years in jail
"Reports indicate that two pirates are seriously injured following heavy gunfire between the Islamic militias and the pirates last night," Andrew Mwangura of the Seafarers' Assistance Programme said in the Kenyan port of Mombasa.
The crew - from India, Sri Lanka, Pakistan, Ethiopia and Eritrea - were safe and "in high spirits", he said.
Mr Mwangura told Associated Press news agency that the pirates will be tried under Islamic law and if found guilty could have their hands cut off.
Last week, 10 Somalis captured by the US navy were sentenced to seven years in jail for piracy and hijacking by a Kenyan court.
Somalia has been in the grip of warlords and militias for years and has not had a functioning national government since 1991.
The UIC has consolidated its control over much of southern Somalia after seizing the capital.
The courts were set up by businessmen who wanted to impose law and order, and their gunmen have become Somalia's strongest fighting force.
The decline in piracy has also been attributed to foreign navy patrols.