Delegates at the UN climate change conference in Buenos Aires have reached agreement on ways to address the issue of global warming.
Emissions in fast-developing China are expected to rise
They approved a compromise proposal on the format of future discussions agreed by the US and the EU overnight.
Some developing countries had threatened to derail the deal, insisting on guarantees that they would not be subjected to emission cuts.
But the demand was rejected by the EU and a new compromise emerged.
The EU-US draft deal ended days of wrangling over discussions on combating global warming.
The issue has kept delegates arguing well past the scheduled close of the two-week conference.
Workmen in the Argentine capital began dismantling conference facilities while talks continued overnight.
Give and take
The agreement seemed in trouble when India - supported by China, Pakistan and Saudi Arabia - called for an amendment at the start of the final session on Saturday.
They insisted on a written guarantee that the deal would not lead to imposition of carbon reduction commitments on developing nations.
The EU opposed this, saying the outcome of future talks should not be prejudiced.
The differences between the EU and the US centred on talks on emission cuts when the Kyoto Protocol expires in 2012.
The Europeans insisted on a series of informal meetings. In the end, the US won its demand for one meeting, next May, but agreed it would be held over several days.
The meeting will be held in Germany and "promote an informal exchange of information" on cutting harmful emissions and adapting to climate change, according to the draft text.
The US - which pulled out of the Kyoto Protocol in 2001 - had until then resisted any talk about longer-term action beyond 2012.
"It is a give-and-take exercise and I think on balance we are very pleased with the outcome," said US lead negotiator Harlan Watson.
EU negotiator Yvo de Boer said the deal contained pretty much something for everyone.
Kyoto commits signatories to trim output of six greenhouse gases, especially carbon dioxide, by at least 5.2% by 2012, compared with 1990 levels.
Tango protest: Activists have been demonstrating at the venue
The Europeans have been seeking to involve the US and major emerging economies, such as China and India, in a post-Kyoto agreement on further emission reductions.
The objections to the draft deal were not shared by all developing countries.
South Africa and a number of smaller states supported the EU's position on Saturday.
Island states threatened by rising sea levels are particularly keen to tackle global warming.
Martin Puta Tofinga, environment minister for the Pacific archipelago of Kiribati, said: "I am talking about survival here; we need to move forward in a meaningful way."