The United Nations has bought a ship to remove oil and avoid a potentially catastrophic spill from a tanker decaying for years off the coast of war-ravaged Yemen, officials said Thursday.

In an unusual step for a UN agency, the UN Development Program said it signed a contract to purchase a crude carrier from major tanker company Euronav that will head to Yemen to remove the oil from the beleaguered FSO Safer.

The 47-year-old ship has not been serviced since Yemen's devastating civil war broke out in 2015 and was left abandoned off the rebel-held port of Hodeida, a critical gateway for shipments into the country heavily dependent on emergency foreign aid.

UNDP chief Achim Steiner called the deal a "major breakthrough."

The effort will "avoid the risk of an environmental and humanitarian disaster on a massive scale," he told reporters at the UN headquarters.

Steiner said the vessel would sail within the next month after routine maintenance underway in China.

"We hope, if all things go according to plan, that the operation of the ship-to-ship transfer would actually commence in early May," he said.

UN officials have voiced fears that the ship would crumble, unleashing an oil spill that would severely impair foreign aid and cost some $20 billion to clean up.

The Safer contains 1.1 million barrels of oil -- four times as much as that spilled in the 1989 Exxon Valdez disaster, one of the world's worst ecological catastrophes, according to the UN.

An ecological disaster could also clog the Bab al-Mandab strait between Africa and the Arabian peninsula, taking a major toll on the global economy by holding up the Suez Canal.

- 'No choice' -

The United Nations had been searching for years for a solution and appealed for a ship donation or a lease.

It finally decided to buy the ship, described as the only one available on the market, after failing to find another option, with prices in the shipping industry spiking in the past year due to Russia's invasion of Ukraine.

"We had no choice, frankly, but to buy a vessel," David Gressly, who coordinates UN humanitarian relief in Yemen, said by video-link from Aden.

"The fact that we have gotten to this step is already bringing a sense of relief here in Yemen," he said.

The salvage operation is estimated to cost $129 million of which $75 million has been received and another $20 million has been pledged, according to the United Nations.

Steiner warned that the United Nations could still suspend the operation if it does not find the remaining funds.

"I do have to say it does surprise me that I have to sit in front of you here today," he said, "still begging for these funds."

The United States, which has contributed $10 million, welcomed the UN announcement and called on other nations as well as private donors to fill the funding gap.

"It is critical that we close this funding gap now so that the UN can complete the emergency operation as quickly as possible," State Department spokesman Ned Price said.

Steiner described the plan as carrying "very significant risks" and going beyond the usual activities of the UNDP.

He said that the United Nations was also still figuring out where the oil would go.

"Let me be very clear -- this is a risky operation and things could go wrong," Steiner said.

"We have done everything we believe we can to mitigate those risks. But at the end of the day, until that oil is taken off, we are operating in an extremely complex operating environment."

Yemen has been wracked by a devastating war since 2014 that has set off one of the world's worst humanitarian crises.

Iranian-backed Huthi rebels have swept much of the country, battling an internationally recognized government supported by a deadly military campaign led by Saudi Arabia.

Gressly said that the two sides dispute who owns the oil, which has complicated the task of getting it out.

"In the end, it seemed more expedient in terms of time to get the oil out and then we can deal with the issue of selling the oil, which is still very desirable, down the road," he said.