TXU, the largest energy provider in Texas, agreed last night to a $45 billion buyout that would not only be the largest private-equity deal in history but would also feature an unusual twist: The buyers have promised environmental groups they would cancel a slew of coal-fired power plants on the firm's drawing boards.

The buyout firms' deal with environmental groups, which could become a landmark in the battle over climate-change policy, would force an abrupt turnaround in the strategy of TXU, which has defied environmentalists' and congressional criticism of its plans to expand coal use and carbon dioxide emissions.

The environmental agreement was the idea of the private-equity firms Texas Pacific Group and Kohlberg Kravis Roberts, which made it a condition of the acquisition, according to several sources involved in the negotiations, who gave details of the deal on condition of anonymity because it had not been announced yet.

Texas Pacific's head, David Bonderman, is no stranger to creative deals in the energy sector or in the cause of environmentalism. Bonderman sits on the boards of the World Wildlife Fund and the Grand Canyon Trust. He was a key figure in negotiating with power plants in Arizona to reduce air pollution over the Grand Canyon. In the TXU case, he tasked William K. Reilly, who had led the Environmental Protection Agency under President George H.W. Bush, to reach out and negotiate with environmental groups.

If shareholders approve the acquisition, TXU would back federal legislation that would require reductions in carbon dioxide emissions through a cap-and-trade system. It would shelve plans for eight of 11 coal-fired plants that current TXU executives had proposed for Texas and would drop plans to build new coal plants in Pennsylvania and Virginia. The company would also double its spending to promote energy efficiency, to $80 million a year, for five years.

"We think this is really a big deal, a watershed moment in America's fight against global warming," said Jim Marston, regional director of Environmental Defense in Austin, who helped forge the environmental accord in a 17-hour negotiating session with the buyout firms on Wednesday. He said it would reshape the electricity sector in Texas and alter the attitudes of Texas congressmen toward climate-change legislation.

The buyout firms also promised to cut TXU's emissions of carbon dioxide, the most prevalent of greenhouse gases scientists blame for global warming, to 1990 levels by 2020. This matches the targets contained in legislation passed last year in California but exceeds anything TXU is obligated to achieve. When the three new coal plants are on line, the company's emissions are projected to be nearly 20 percent higher than they were in 1990.

In return, Environmental Defense, which has been leading the fight against TXU's coal expansion plans, would drop its objections to the three large new units, including two 800-megawatt units at Oak Grove, Tex., and a 600-megawatt plant at Sandow, Tex. The private-equity firms held an initial round of talks on Friday with another environmental group that opposes the Oak Grove units.

The unusual talks between the buyout firms and environmental groups began Feb. 14. Reilly, who now heads a Texas Pacific subsidiary that invests in water projects in the developing world, called Fred Krupp, president of Environmental Defense.

"Reilly told us that they were negotiating to buy TXU but that they would not go through with the deal unless they could re-create the company as a green electricity generator," Marston said.

Last Tuesday, Marston got a phone call asking him to get on a plane in two hours and fly to the Texas Pacific headquarters in downtown San Francisco. Talks began 8 a.m. in a Texas Pacific conference room, and by 1 a.m. Thursday, they had a three-page list of commitments. Then the buyout executives flew in a private jet to Austin to discuss them with Texas Gov. Rick Perry (R) and other state leaders.

Although the deal is not a contract and wasn't signed, the buyout firms say they intend to fulfill the commitments.

The board of TXU met last night to vote on the leveraged buyout, which would eclipse the previous record of $31.3 billion, paid for RJR Nabisco in 1989. That deal was the subject of the popular journalistic account "Barbarians at the Gate." Texas Pacific and KKR would pay about $70 per share for TXU, or about $32 billion, and assume more than $12 billion in debt. The deal could be officially announced as early as today.

Bonderman is trying to ensure that this buyout has a happier ending than a utility deal he attempted in 2004. Then, Bonderman tried to acquire Portland General Electric from the bankrupt Enron, but it ended up as a public relations disaster. Despite efforts to assuage customers and grass-roots groups, the buyout sparked picketing and vociferous opposition from Oregon legislators. The state's utility commission rejected the proposal in 2005.

This time, Bonderman was personally involved in the initial meetings with environmental groups. He assigned Reilly to lead the negotiations. He and his partners at Kohlberg Kravis Roberts also told TXU that they would walk away from the deal if the energy giant didn't scale down its coal plant expansion plans as a concession to environmental groups.

"Anyone doing an energy investment in today's situation has got to be sensitive of the change in the attitudes of the culture and the change in the attitudes of the country, and particularly the attitudes of Congress," said a person involved in the negotiations who spoke on condition of anonymity because the deal had not yet been announced.

But there are financial advantages to the environmental agreement, as well. When they acquire companies, private-equity firms typically try to cut costs rather than expand operations. TXU had estimated that the ambitious coal plant expansion would cost at least $10 billion; others suggested that with soaring construction costs, the ultimate price tag could be much higher.

Many power industry executives said they doubted TXU ever meant to build all 11 plants. "I think it is a bit of a gimmick," said the chief executive of another utility, who spoke on condition of anonymity for business reasons. He said that deregulation of the utility business in Texas has opened the state to competition on power generation. But with TXU claiming to build so much new generation, "who's going to jump in and say they don't believe them?"

Sources involved in the negotiation said TXU's assets -- which encompass a retail business with 2.4 million customers; more than 50 generating plants, including a nuclear facility; and a power wholesale business -- would not be split up if the deal gains approval from shareholders.

A turnaround at TXU would represent a reproach to C. John Wilder, TXU's chief executive, who in the past has criticized new technology that burns coal with fewer greenhouse gases as too expensive or technologically unsound. Although he is expected to retain his position at TXU, Wilder would be expected to consult with a new environmental advisory board that would include representatives from Environmental Defense and the Natural Resources Defense Council in San Francisco.