BALI, Indonesia - Delegates to the U.N. climate conference here have agreed to include forest conservation in any future discussions about a new global-warming pact, paving the way for billions of dollars in new spending to attack illegal logging.

With deforestation accounting for 20 percent of global emissions, governments are desperate to find a solution to a problem fueled by rising demand for timber and palm oil, widespread corruption, and endemic poverty.

The program, Reducing Emissions From Deforestation and Degradation, aims to pay developing countries, most in the tropics, enough money to keep their trees in the ground - and thus continuing to absorb carbon - rather than allowing them to be chopped down for a profit.

The agreement will be part of negotiations for a successor to the Kyoto Protocol when it expires in 2012 and is "a good balance between different countries' views," EU Environment Commissioner Stavros Dimas said Friday.

"It is one of the substantial achievements of this conference."

Saving tropical rain forests, especially in the Amazon, Indonesia, and the Congo basin in Africa, has been marked by three decades of failures.

About 32 million acres of forest - twice the size of Panama - are lost each year to logging, agriculture and other activities, according to the World Bank. Brazil and Indonesia - where 80 percent of carbon dioxide emissions come from deforestation - are affected the most because of rampant illegal logging and the growing demand for biofuels and other commodities, such as soybeans.

But with as much as $23 billion - the amount of money that could be raised through the program - conservationists and governments from tropical countries say there is renewed hope the trend can be reversed.

"This is an important agreement because we need to have emissions included in the Bali road map," said Greenpeace Brasil's Paulo Adario.

The agreement calls for providing assistance to reduce deforestation and what is called degradation - mostly farming and small-scale logging that destroys the forest undergrowth. It also includes a reference to conservation - a demand of India and Costa Rica, which want financial assistance for work already done to protect their forests.

Other projects would help develop mechanisms to determine the best way to verify a country's claims of reducing deforestation and the method of providing assistance.

Brazil, for example, would like Western governments to provide aid to a fund for countries that are reducing deforestation. Papua New Guinea and other nations want a system where countries could get credit for saving their forests; that credit eventually could be traded for money.