DURBAN, South Africa - A U.N. climate conference reached a hard-fought agreement early Sunday on a complex and far-reaching program meant to set a new course for the global fight against climate change for the coming decades.

The 194-party conference agreed to start negotiations on a new accord that would put all countries under the same legal regime enforcing commitments to control greenhouse gases. It would take effect by 2020 at the latest.

The deal also set up the bodies that will collect, govern, and distribute tens of billions of dollars a year to poor countries to help them adapt to changing climate conditions and to move toward low-carbon economic growth.

Currently, only industrial countries have legally binding emissions targets under the 1997 Kyoto Protocol. Those commitments expire next year, but they will be extended for five years under the accord adopted Sunday.

The breakthrough capped 13 days of hectic negotiations that ran a day and a half over schedule, including two round-the-clock days that left negotiators bleary-eyed and stumbling with words.

Delegates were seen nodding off in the final plenary session despite the high drama, barely constrained emotions, and uncertainty whether the talks would end in triumph or total collapse.

The nearly fatal issue involved the legal nature of the accord that will govern carbon emissions by the turn of the next decade.

A plan put forward by the European Union sought strong language that would bind all countries equally to carry out their emissions commitments.

India led the objectors, saying it wanted a less rigorous option. Environment Minister Jayanthi Natarajan argued that the EU proposal undermined the 20-year-old principle that developing countries have less responsibility than the industrial nations that caused the global warming problem through 200 years of pollution.

"The equity of burden-sharing cannot be shifted," she said in angry tones.

"India will never be intimidated by threats," Natarajan said. "How do I give a blank check and give a legally binding agreement to sign away the rights of 1.2 billion people?"

Chinese envoy Xie Zhenhua said rich nations were "not acting on their commitments" to cut greenhouse gases.

The debate ran past midnight and grew increasingly tense as speakers lined up almost evenly on one side or the other. Conference president Maite Nkoana-Mashabane, South Africa's foreign minister, called a recess and told the EU and Indian delegates to put their heads together and come up with a compromise formula.

After weeks of unsuccessful efforts to resolve the issue, Nkoana-Mashabane gave Natarajan and European Commissioner Connie Hedegaard 10 minutes to find a solution, with hundreds of delegates milling around them.

"We heard some interesting proposals from India on equity," Hedegaard said. She stressed that the focus should be on helping "land this Durban package."

This article contains information from Bloomberg News.