Islamic fighters stormed a hijacked ship and recaptured it after a gun battle with pirates off Somalia's lawless coast, officials said Wednesday.

Two Somali pirates were seriously wounded during the attack on the commercial vessel, but all 14 crewmembers were safe, said Andrew Mwangura, head of the Kenyan chapter of the Seafarers Assistance Program.

Click here to go to FOXNews.com's Africa Center.

About 30 Islamic fighters stormed the ship late Tuesday, arriving aboard three speedboats and armed with automatic weapons, he said by telephone after Islamic officials in the Somali capital, Mogadishu, informed him of the ship's recovery.

"All the crew are safe and the vessel has been recaptured," Mwangura said.

It is the first rescue of a ship hijacked by pirates since the Islamic movement seized the capital from warlords in June. They have been expanding their control across the south of the country since then. Somalia has not had an effective national government since 1991, when warlords overthrew dictator Mohammed Siad Barre and then turned on one another, throwing the country into anarchy.

Click here to go to FOXNews.com's Africa Center.

The ship, which is registered in the United Arab Emirates, was seized last week while heading back to the UAE. It was carrying charcoal.

The pirates had demanded a ransom of $1 million.

The ship will return to Mogadishu but is currently anchored 250 miles north of the capital.

Piracy is rampant off the coast of Somalia, and rose sharply last year, with the number of reported incidents at 35, compared with two in 2004, according to the International Maritime Bureau.

The bandits target both passenger and cargo vessels for ransom or loot. Somalia's 1,860-mile coastline is Africa's longest.