The United Nations security council has agreed to the deployment of UN monitors to observe the implementation of a ceasefire in the Yemeni port of Hodeidah.

A UK-drafted resolution supporting the ceasefire, agreed in Stockholm, was adopted on Friday afternoon, the first UN resolution on Yemen in more than three years.

The news was welcomed by aid agencies. “Today, at last, the council has taken a much needed step to respond to the urgency of the humanitarian disaster as well as the international community’s growing outrage and desire to put an end to the brutal war in Yemen,” said Frank McManus, Yemen country director for the International Rescue Committee.

“With more than 20 million Yemenis facing severe hunger, and 10 million on the brink of famine, it is imperative the agreements reached in Sweden are implemented effective immediately, and all parties to the conflict commit to further talks in January.”

However, the resolution was only agreed after it was stripped of much the language on guaranteeing humanitarian deliveries and the need for accountability for war crimes. The edits were on the insistence of the US mission, reflecting the views from the Saudi and Emirati coalition, which has resisted any UN constraints on its operations in Yemen.

When diplomats reconvened at dawn on Friday after a long night of negotiations, the US stunned the UK and other European missions by threatening to veto the British resolution if the humanitarian language was not pruned and a clause inserted explicitly condemning Iran for its role as a backer of the Houthi rebels – an insertion that was blocked by Russia.

It is highly unusual for the western allies at the UN to threaten each other with vetoes. One official involved in the talks said he had “never really seen anything like this”.

Another diplomat said: “I don’t know if the [veto] threat is unprecedented. It is certainly surprising and disappointing. In the end, however, we managed to bridge the gap and come to agreement.”

Oxfam welcomed the resolution, calling it “long overdue and much needed”. But its senior humanitarian policy adviser, Kathryn Achilles, said: “After three and a half years of silence, this resolution does not go far enough in demanding accountability for violations of international humanitarian law. And with the looming risk of an immense famine, it does not appropriately convey the urgency of revitalizing Yemen’s economy or removing restrictions from its air and sea ports.”

Diplomats at the UN believe that it reflected a shift in broader US foreign policy, under the national security adviser, John Bolton, the secretary of state, Mike Pompeo, and the president’s son-in-law, Jared Kushner, which has elevated the importance of the US relationship with Saudi Arabia and downgraded the relationships with European allies.

“Everything about US foreign policy is difficult to explain right now,” a European diplomat said.

The resolution calls for the Hodeidah ceasefire, which came into force on Tuesday, to be respected and for the warring parties not to bring reinforcements into the city, which is a vital entry point for food and medicine for a country on the brink of famine.

Forces are also to be withdrawn within three weeks from the city and port of Hodeidah and the ports of Salif and Ras Issa.

The resolution calls on the parties to continue to work with the UN special envoy, Martin Griffiths, on stabilising the Yemeni economy and keeping the airport open in the capital, Sana’a.

The resolution also authorised the UN secretary general, António Guterres, to “establish and deploy, for an initial period of 30 days from the adoption of this resolution, an advance team to begin monitoring and to support and facilitate the immediate implementation of the Stockholm agreement”. Guterres is then meant to submit proposals before the new year on a longer-term UN monitoring mechanism.

The UK had included language calling on the warring sides to comply with requests from the UN humanitarian chief, Mark Lowcock, to safeguard the delivery of humanitarian supplies. In the amended text that is summarised with fewer details.

A passage expressing grave concern about the “growing threat of conflict-induced famine and the devastating impact of the conflict on civilians” was dropped, as was call for “transparent, credible and timely investigations” into war crimes and for those responsible to be held to account.

“What has been lost is a sense of international consensus around priorities in Yemen,” said Peter Salisbury, an analyst at the International Crisis Group. “The mind boggles at what should have been something really simple and positive has become so difficult, and managed to muddy the waters as such a fragile moment.”