Troops from the Somali region of Puntland say they have freed 22 hostages captured by pirates on a ship off the coast of Yemen in 2010.
A statement issued on Sunday said the rescue followed two weeks of "fighting pirates and laying siege to the vessel".
The MV Iceberg One, which is owned by a firm in Dubai and sailed under a Panamanian flag, was seized in the Gulf of Aden in March 2010.
It was being held near Gara'ad village on the coast in Mudug region. Troops surrounded the villahe on 10 December.
A BBC correspondent said it is rare for Somali forces to move on pirates in this way.
AAP reports the rescued crew members were believed to hail from several countries including Ghana, India, Pakistan, the Philippines, Sudan and Yemen.
Piracy has long flourished off Somalia. But the pirates have lost ground this year after increased naval patrols and armed security aboard ships in the Gulf of Aden and the Indian Ocean.