(Changes dateline, adds Islamists' quotes paragraph 4-5) By Sahal Abdulle MOGADISHU, Nov 8 (Reuters) - Islamist fighters who control a large area of southern Somalia stormed a ship hijacked by pirates and recovered it overnight. On Wednesday the Islamists said they would prosecute their captives through sharia law. According to this law, pirates are punished the same way as highway robbers with the amputation of a left leg and right arm. The recovery was the first delivery by the Islamists on a promise to stamp out rampant piracy in the shipping lanes along its coast, the longest in Africa. The Islamists seized the capital in June from U.S.-backed warlords and went on to take over much of south-central Somalia, imposing sharia law. "After heavy exchange of gunfire last night in the ocean, we arrested eight pirates," Sheikh Sharif Ahmed, head of the executive wing of the Islamist Courts, told reporters. "These men will be charged according to the sharia law." He said there had been no casualties. Andrew Mwangura, coordinator of the Seafarers Assistance Programme, had earlier told Reuters all 14 crew of the United Arab Emirates-registered ship were safe but two pirates had been seriously wounded during the Islamist boarding. The ship was seized off the Somali coast on Thursday. The crew came from India, Sri Lanka, Pakistan, Eritrea and Ethiopia, Mwangura said. Backed by wealthy Somali businessmen, the Islamists have sought to impose law and order to boost trade that had been reliant on a capricious system of warlord fiefdoms during the country's 15 years without a proper government. Piracy is endemic off the Somali coast but increased foreign patrols and the anti-piracy stance by the Islamists have stemmed attacks. Last week's hijacking came a day after a landmark case in which 10 Somalis arrested in international waters by the U.S. Navy were jailed for seven years for piracy by a Kenyan court. (Additional reporting by Helen Nyambura-Mwaura)