WASHINGTON - After late-night wrangling at United Nations talks in Lima, Peru, negotiators early Sunday reached a watered-down deal that set the stage for a global climate agreement next year in Paris.

The deal was adopted hours after a previous draft was rejected by developing countries that accused rich nations of shirking their responsibilities to fight global warming and pay for its effects.

Peru's environment minister presented a fourth draft just before midnight and said he hoped it would satisfy all parties, giving a sharply reduced body of remaining delegates an hour to review it.

"As a text it's not perfect, but it includes the positions of the parties," said the minister, Manuel Pulgar-Vidal, who was the conference chairman and had spent all afternoon and evening meeting separately with delegations.

The main goal for the two-week session in Lima was relatively modest: agree on what information should go into the pledges that countries submit for a global-climate pact expected to be adopted next year.

But even that became complicated as several developing nations rebelled against a draft decision they said blurred the distinction between what rich and poor countries could be expected to do.

The final draft apparently alleviated those concerns with language saying countries have "common but differentiated responsibilities" to deal with global warming.

It also restored language demanded by small island states at risk of being flooded by rising seas, mentioning a "loss-and-damage" mechanism agreed upon in last year's talks in Poland.

"We need a permanent arrangement to help the poorest of the world," Ian Fry, negotiator for the Pacific Island nation of Tuvalu, said at a midday session.

However, it weakened language on the content of the pledges, saying they may instead of shall include quantifiable information showing how countries intend to meet their emissions targets.

Also, top carbon polluter China and other major developing countries opposed plans for a review process that would allow the pledges to be compared against one another before Paris.

The new draft said only that all pledges would be reviewed a month ahead Paris to assess their combined effect on climate.

Though negotiating tactics always play a role, almost all disputes in the U.N. talks reflect a wider issue of how to divide the burden of fixing planetary warming that scientists say results from human activity, primarily the burning of oil, coal, and natural gas.

Momentum from last month's joint U.S.-China deal on emissions targets faded quickly in Lima as rifts reopened over who should do what to fight the problem.

Historically, Western nations are the biggest emitters. Currently, most carbon dioxide emissions come from developing countries as they grow their economies and lift millions of people out of poverty.

During a brief stop Thursday in Lima, U.S. Secretary of State John Kerry said fixing the problem was "everyone's responsibility because it's the net amount of carbon that matters, not each country's share."

Scientific reports say climate impacts are already happening and include rising sea levels, intensifying heat waves and shifts in weather patterns causing floods in some areas, droughts in others.