Pirates are holding the MV Faina off the town of Harardhere
Somali pirates holding a ship full of military hardware have reached a deal with its Ukrainian owners to let it go, reports say.
Gunmen seized the Kenya-bound MV Faina, carrying 33 tanks, grenade launchers and ammunition, on 24 September.
A pirate spokesman said releasing the ship was "a matter of time" but gave no details of a ransom payment.
A spokesman for the ship's Ukrainian owner reportedly said the release could happen within a week.
Attacks by Somali pirates have escalated sharply in recent months, causing international concern.
Last month they seized a Saudi oil tanker, the Sirius Star, carrying oil worth more than $100m (£65m). Negotiations are currently under way for the release of the vessel and its 25-man crew.
92 attacks this year - most in the Gulf of Aden
36 successful hijackings
14 ships currently held, including the MV Faina carrying tanks
268 crew held hostage
Source: International Maritime Bureau, 2008
The MV Faina, currently anchored off the pirate hub of Harardhere, has a mostly Ukrainian crew of 21. Pirates had initially demanded a ransom of $20m.
"It is just a matter of time and a few technicalities before the ship recovers its freedom," French news agency AFP quoted Sugule Ali speaking on behalf of the pirates.
"I can't tell you what the ransom is but what can I say is that an agreement has finally been reached," he added.
Mikhail Voitenko, said to be a spokesman for ship owner Vadim Alperin, was quoted by the Associated Press news agency as saying: "The owner has confirmed there is every reason to hope that it will be released in the coming week."
A Kenyan maritime official confirmed the deal and said the two sides were now "discussing the modalities of releasing the ship, crew and cargo".
Kenya says the arms are destined for its military, rejecting reports they were bound for the government of semi-autonomous southern Sudan.
Somalia has not had an effective national government for 17 years, leading to a collapse of law and order both on land and at sea.
Pirates there are currently holding more than a dozen hijacked ships.