The Ukrainian sailors are said to be in good health
A Greek ship with a Ukrainian crew that had been held by Somali pirates since May has been freed, Ukraine's president and the vessel's owners say.
President Viktor Yushchenko confirmed the release after Ariana's Athens-based owners said they had paid an undisclosed sum to the pirates.
The pirates claimed that they received nearly $3m (£1.8m) in ransom.
The ship and its 24-strong crew were captured as it sailed south-west of the Seychelles on 2 May.
"I congratulate the nation, and I congratulate the families on the successful operation to free our sailors," said Mr Yushchenko.
He said negotiations with the pirates had been "very difficult", adding that a plane would soon bring the crew back to Ukraine.
Alloceans Shipping, the company which owns the vessel, also announced that the ship had been freed.
The Ukrainian sailors were in good health, company director Spyros Minas said.
He said the pirates had already left the ship.
The Maltese-flagged vessel, said to be carrying 35,000 tons of soya, was sailing from Brazil to the Middle East when it was captured, Alloceans Shipping said.
Shipping off the Horn of Africa has been plagued by piracy for years.