Pirates in the town of Harardhere, off the coast of which the MV Faina had been held since its capture on September 25, said more than $3m in ransom had been paid.
"The deal was $3.5m. The owners of the ship wanted to pay only one million but we resisted," said one pirate on condition of anonymity.
"There was a time we thought of releasing the ship without any payment on humanitarian grounds but we spent a lot of borrowed money on khat cigarettes, coca cola, mineral water and food"
Ahmed Mohamed Abdi, senior Somali pirate
Ali confirmed a ransom was paid but would not reveal the amount, describing it only as "not huge... something to cover our expenses".
Fishermen and pirates in the Harardhere area said they had spotted navy ships from an international anti-piracy coalition moving towards the freed Ukrainian vessel and transferring men onboard.
The Ukrainian presidency also confirmed the ship's release in a statement and said the vessel had resumed its journey to its initial destination, the Kenyan port of Mombasa.
But sources close to the pirates believe that the Faina does not currently have enough fuel to reach the destination.
The office of Viktor Yushchenko, the Ukrainian president, said: "On February 4, the ship was freed after a very difficult operation carried out by the Ukrainian special services in co-operation with foreign special services."
It was unclear what part the special services played but according to sources close to the pirates, the ransom money was flown from Nairobi and dropped to the pirates by parachute at approximately 1200 GMT on Wednesday.
The sources said the air-dropped capsule contained $3.2m.
"Somali pirates are very quick at counting money, they have equipment. Three million dollars is a matter of 15 minutes, but there can be disagreements between them," said one source close to the case, speaking on condition of anonymity.
In the final stages of the ransom negotiations, no fewer than 50 pirates were onboard the ship and fishermen, elders and other witnesses in Haradhere said they saw the first groups return from the ship early on Thursday.
|The United States navy had been observing the vessel [EPA]
The capture of the ship, which had battle tanks and other weaponry on board, was one of the longest and most high-profile hijackings since Somali piracy surged in 2007.
The vessel's captain died, reportedly of natural causes, two days after the ship was seized in the Indian Ocean.
Pirates had initially demanded $35m to release the ship but talks were slow to start in earnest with the Ukrainian ship owners, following threats of military action.
"We were fed up with the Faina," said Ahmed Mohamed Abdi, one of the pirates, shortly after receiving his share.
"There was a time we thought of releasing the ship without any payment on humanitarian grounds but we spent a lot of borrowed money on khat cigarettes, coca cola, mineral water and food," he said.
Controversy still surrounds the intended recipient of the MV Faina's cargo, which includes 33 Soviet-era T-72 battle tanks and at least 14,000 rounds of different types of ammunition.
After the vessel's seizure in September, Kenya claimed the weaponry was for its armed forces.
However, several sources have since revealed that the cargo was intended for the government of South Sudan.
According to organisations monitoring sea piracy, Somali pirates hijacked at least 49 foreign vessels in the Gulf of Aden and Indian Ocean last year, raking in tens of millions of dollars in ransom money.
At least 12 foreign ships are still held by Somali pirates.