A U.N. official says Somali pirates have released four Thai sailors who were held hostage for nearly five years.

The U.N. Special Representative for Somalia Nicholas Kay said Friday that the four released on Wednesday were sailors of the FV Prantalay 12 vessel, seized by Somali pirates on April 18 2010. Kay said this is the longest period of captivity of hostages held by Somali pirates.

Kay said the ship was used by the pirates as a base before it eventually capsized in July 2011 and the remaining crew were taken ashore.

Kay said in a statement that six members of the original crew of 24 succumbed to illness and 14 crew members from Myanmar were released to the Puntland Maritime Police authorities and repatriated in May 2011.