Pirates who hijacked a Ukrainian ship loaded with weapons have received a ransom and have left the vessel, reports from Somalia say.
The pirates seized the Kenya-bound MV Faina and its crew in September 2008.
They initially demanded a ransom of $20m, but reports suggest that a figure of $3.2m (£2.2m) was agreed, following months of negotiations.
The MV Faina was the highest profile vessel held by pirates. The intended destination of its cargo was disputed.
The Kenyan government says the tanks, rocket launchers and small arms on board are theirs, but the manifest suggests the arms were heading for South Sudan.
'Counting the haul'
Gunmen took control of the MV Faina and its crew of 20 on 25 September 2008 as it headed for the Kenyan port of Mombasa.
It has since been moored off the town of Harardhere, along with a number of other vessels seized by the pirates.
The US navy said that a ransom appeared to have been dispatched on Wednesday and Mikhail Voitenko, said to be a spokesman for ship owner Vadim Alperin, later said that the pirates were "counting the haul".
Early on Thursday groups of pirates began leaving the vessel, reports from Haradhere said. Representatives of the pirates then told journalists that the ship had been freed.
"We have released MV Faina. There were only three boys remaining and they delayed the release for one hour, but now the ship is free," one of the pirate leaders, Sugule Ali, told AFP news agency by phone.
"No huge amount has been paid, but something to cover our expenses," he added
The crew - 17 Ukrainians, two Russians and a Latvian - were healthy and safe, a statement from the Ukrainian presidency said, and the ship would head to Mombasa under the protection of the US navy.
A number of warships from foreign navies had been diverted to the area to monitor the situation, in part to ensure that the cargo of weaponry did not get into the hands of Somali insurgents.
Once the ship is under way, the focus is likely to shift to its cargo of weapons and its final destination, reports the BBC's Peter Greste from the Kenyan capital, Nairobi.
The Kenyan government would be highly embarrassed to be found supplying arms to South Sudan, analysts say.
It was Kenya that helped broker an end to the civil war between South Sudan and the government in Khartoum in 2005.