The US withdrawal of a resolution exempting its peacekeepers from the jurisdiction of the International Criminal Court (ICC) came in the face of mounting opposition from UN Security Council members.
By Susannah Price
BBC correspondent at the United Nations
The resolution was first passed unanimously two years ago by the Security Council, which was concerned about the future of peacekeeping missions after the US initially vetoed a resolution extending the mission in Bosnia.
Last year three countries - France, Germany and Syria - abstained from the vote which granted another year's immunity.
The US argued its troops could be subject to malicious prosecution
The exemption is due to run out at the end of June.
Initially the US circulated its resolution last month when France and Germany made it clear they would abstain again. At that time it was assumed the measure would pass, although the US delayed putting it forward to push through the resolution on Iraq first.
However over the past few weeks, the continuing allegations about Iraqi prisoner abuse by US military personnel has changed attitudes.
It was initially thought the Chinese might support the resolution, but they eventually abstained. The Chinese ambassador Wang Guangya said the continuing news coverage meant they could not give the US a "blank cheque".
Support falls away
UN Secretary General Kofi Annan also played a key role in persuading undecided countries not to back the Americans.
He came out strongly against the idea of a blanket exemption saying it would discredit the Security Council.
Several countries, such as Chile, were also concerned about the effect of a divided vote on the Council.
Earlier this month the Security Council united to back US plans for Iraq's future and Washington was praised for its flexibility. Many expressed the hope that the divisions in the lead up to the Iraq war were behind them.
The Americans appeared to agree. When US deputy ambassador James Cunningham announced that the draft resolution would be withdrawn, he acknowledged that not all council members agreed that the draft resolution met everyone's concerns.
He added that they would withdraw it to "avoid a prolonged and divisive debate".
It was unclear until the last minute whether the US would have the necessary nine votes to pass the resolution.
It offered a compromise on Tuesday which would make this the last renewal of the exemption.
However this was not enough for Security Council members. France, China and Germany stuck to their position while Spain's decision to abstain may have persuaded other waverers such as Romania.
Eventually it seemed unlikely that the US would have got more than six votes in favour. Supporters included the UK, Washington's main coalition partner in Iraq, and the Philippines.
What is still not clear is how far the US will go to carry out its threat to block future UN peacekeeping operations.