The UN Security Council voted unanimously for the 12-month exemption - to be renewed annually - to end a bitter row threatening peacekeeping operations.
Canada's ambassador to the UN, Paul Heinbecker, said the Security Council had exceeded its powers.
But America warned of "serious consequences" if the International Criminal Court (ICC) ever arrested a member of the US military.
The BBC's UN correspondent says the new resolution will have little practical effect on the court's work.
But he says it has set the bad precedent of Security Council interference in an internationally agreed treaty.
'Not in mandate'
Ambassador Heinbecker told reporters: "We think this is a sad day for the United Nations.
"We don't think it's in the mandate of the Security Council to interpret treaties that are negotiated somewhere else."
The compromise resolution permitting the one-year exemption in investigating or prosecuting peacekeepers applies to countries, like the US, that do not support the ICC.
But the possibility that the exemption would not be renewed brought a stiff warning from US Ambassador to the UN, John Negroponte.
"We cannot accept a structure that may transform the political criticism of America's world role into the basis for criminal trials of Americans who have put their lives on the line for freedom," he said.
"Should the ICC eventually seek to detain any American, the United States would regard this as illegitimate.
"No nation should underestimate our commitment to protect our citizens."
President Bush's administration had been threatening to veto all future UN peacekeeping missions if the American military was not granted permanent immunity from the ICC.
After the compromise Security Council resolution was passed, the UN's peacekeeping mandate in Bosnia was immediately renewed.
'Time out'
Human rights groups attacked the deal.
"For all its arm-twisting, Washington got only a temporary reprieve of dubious legality and a strong taste of global outrage," said Richard Dicker of Human Rights Watch.
The British Ambassador at the UN, Sir Jeremy Greenstock, defended the deal.
He said it would offer a "time out for the right action to be taken by the member state whose nationals are accused or indicted".
And France's Jean-David Levitte said the compromise was "absolutely in line with the statute of Rome" which set up the ICC.
The ICC is the first permanent court to try war crimes, crimes against humanity and genocide.
The Rome Statute entered into force on 1 July and the court is expected to begin processing charges in The Hague in about a year.