The UN security council has adopted a resolution calling for Hamas to agree to a three-phase hostage-for-ceasefire proposal outlined by Joe Biden, the first time the body has endorsed a comprehensive peace deal to end the Gaza war.

A Hamas statement said the group welcomed the resolution, though it was not immediately clear if that meant the leadership in Gaza accepted the ceasefire plan.

After the vote, the US president, Joe Biden, wrote on X “The UN Security Council just adopted our resolution calling on Hamas to accept the deal to establish a ceasefire with the release of hostages. Hamas says it wants a ceasefire. This deal is an opportunity to prove they mean it.”

The position of the Israeli government is also ambiguous. It has officially accepted the peace plan but the prime minister, Benjamin Netanyahu, has sought to distance himself from it, and his coalition has shifted to the right since the proposal was put forward.

Fourteen council members voted for Monday’s resolution, none against, and only Russia abstained on the US-drafted resolution, which calls for an initial exchange of elderly, sick or women hostages for Palestinian detainees held by Israel in the course of an initial six-week ceasefire.

The ceasefire would evolve into a permanent end to hostilities and the release of all hostages in a second phase that would be negotiated by the two parties and US, Qatari and Egyptian mediators. A third phase would involve the launch of a major reconstruction effort.

The resolution calls on Hamas to accept the agreement and urges both parties “to fully implement its terms without delay and without condition”.

The US has been seeking UN endorsement for the proposal since it was unveiled by Biden on 31 May. It won the support of the Palestinian mission, with a clause saying that an initial six-week ceasefire would be extended as long as talks continued over a second phase.

The resolution said the US, Qatar and Egypt would “work to ensure negotiations keep going until all the agreements are reached and phase two is able to begin”.

A Palestinian presidential spokesperson, Nabil Abu Rudeineh, said the Palestinian Authority leadership would accept any resolution calling for an immediate ceasefire in Gaza which preserved Palestinian territorial integrity.

Palestinian support for the US resolution made it much harder diplomatically for Russia or China to veto it. Since the start of the Gaza war in October, the security council has struggled to find consensus against a backdrop of deep polarisation. It has agreed on humanitarian resolution involving temporary ceasefires but this is the first time it has embraced a comprehensive peace.

“Over the past eight months this council has often faced divisions and the world has taken notice with understandable frustration,” the US envoy to the UN, Linda Thomas-Greenfield, said after the vote. “But there’s another side to this story because today we adopted a fourth resolution on this conflict.”

She declared: “Colleagues, today we voted for peace.”

The text stated that Israel had already accepted the ceasefire terms, though that claim is increasingly in question, as the country’s prime minister, Benjamin Netanyahu, has made a string of sceptical comments on it, claiming that the US had only revealed parts of the plan, and insisting that any proposal for a lasting ceasefire without the complete destruction of Hamas’s military and governing capacity is a “non-starter”.

The resignation over the weekend of a centrist minister, Benny Gantz, has left Netanyahu even more dependent on far-right members of his coalition, who adamantly oppose the deal.

Hamas made positive comments when Biden first announced the deal, and said it welcomed the security council vote, but it has yet to give a formal response to the ceasefire proposal. The unusual show of relative unity by a deeply divided security council helps put pressure on both parties to strike an agreement, though both have shown themselves far more influenced by local constituencies and the personal interests of leaders, than by international public opinion.

Prospects for a hostage and ceasefire deal were significantly complicated by an Israeli raid in Gaza on Saturday to rescue four hostages, which killed 274 Palestinians.

One of the late changes made to the US draft resolution was designed to make it more palatable to Israel. It said the security council rejected any attempt to change the demographic or the geographical boundaries of Gaza, but it omits wording from the earlier version which specifically rejected the creation of a buffer zone around the coastal strip.