Governments at the UN Earth Summit have clinched a general deal to promote the use of "green" energy but an overall pact is still blocked by a new dispute over healthcare and abortion.
"I'm happy that we have agreed," Mr Poul Nielsen, European Commissioner for Development, told Reuters after marathon talks. But environmentalists were incensed, saying it would do nothing to promote clean, renewable energies like solar or wind power.
A dispute involving female genital mutilation and women's rights to abortion and contraception blocked an overall global deal at the summit on a blueprint to combat poverty while protecting the planet, Mr Nielsen said.
The energy deal agrees a "substantial increase" in the use of renewable energy like solar or wind power but stops short of setting any clear global targets in what environmentalists said was a sell-out to US President George W Bush's former colleagues in the oil industry.
"We're calling it the Bush-Cheney energy plan," said Ms Jennifer Morgan of the World Wildlife Fund.
"The Americans, Saudis and Japanese have got what they wanted ... It's worse than we could have imagined," Mr Steve Sawyer, climate policy director of Greenpeace said.
Away from the negotiating sessions, a parade of heads of state and government took to the podium to support its lofty goals, urged on by children who demanded an end to international bickering and broken promises a decade after at the first Earth Summit in Rio de Janeiro 10 years ago.
"Too many adults are too interested in money and wealth to take notice of serious problems that affect our future," said 11-year-old Justin Friesen from Canada, standing next to UN Secretary-General Kofi Annan on the podium before the leaders.
But the reality of human conflict was everywhere in view.
In the main hall Third World leaders blasted greed among the rich nations as tensions over Iraq and Zimbabwe crackled.
In downtown Johannesburg, police turned water cannon on about 100 pro-Palestinian protesters outside a venue where Israeli Foreign Minister Shimon Peres was due to speak.
The health issue is the last hurdle to agreeing a plan tackling a host of threats to mankind, from pollution and poverty to AIDS and the extinction of plant and animal species.
"It's the only thing left. It's not clear if we'll get an agreement tonight," one European delegate said.
Skeptics say the Summit's vast ambition deprives it of meaning, especially as the United States has resisted what it sees as empty symbolism in setting targets for such sweeping goals and argues that many nations will simply ignore them.
"We deal with everything and there is a risk at the end of the day that it means nothing," said Danish Prime Minister Anders Fogh Rasmussen, whose country holds the EU presidency.