Somali pirates and owners of a Ukrainian ship carrying 33 tanks and other military hardware have reached a deal to release the vessel, a Kenyan maritime official said on Sunday.
Gunmen captured the MV Faina on 24 September with its cargo of T-72 tanks, grenade launchers and ammunition, and demanded $US20 million in ransom.
The official said a deal had been reached but discussions were continuing over how to deliver the money and release the ship.
The 20 crew members aboard include 17 Ukrainians, Russians and Latvians.
On Tuesday, a member of the group that seized the vessel said they had lowered their ransom demand to $US3 million from $US8 million.
Pirates holding the Saudi super-tanker Sirius Star said on Saturday they were hoping for a "favourable" response to their $US25 million ransom demand ahead of a deadline which expired on Sunday.
Mohammed Said, the leader of the gang that seized the tanker on 15 November said negotiations to free the vessel were ongoing but did not know when they would conclude.
He was yet to comment on the fate of the ship, the biggest ever seized by pirates, as their ransom ultimatum drew near.
The ship's seizure has sown panic across the shipping world with some firms opting to re-route to the Cape of Good Hope, causing delays and hiking costs.
Ethiopia on Saturday accused its rival Eritrea of supporting the pirates, whose rampant attacks on vessels have threatened to choke one of the world's key maritime routes.