Dynegy Inc. agreed to buy $6.25 billion of power plants from Duke Energy Corp. and private- equity firm Energy Capital Partners, almost doubling its generating capacity less than a year after emerging from bankruptcy protection.

The sale includes $2.8 billion for 11 Duke natural gas, coal and oil power plants in Ohio, Pennsylvania and Illinois as well as its retail sales business, Houston-based Dynegy said in a statement today. In a separate transaction, Dynegy is spending $3.45 billion for Energy Capital plants in Massachusetts, Connecticut, Pennsylvania, Illinois and Ohio.

Duke is one of several utility owners seeking to divest power plants that compete for buyers on wholesale markets, instead favoring returns from units with customers paying regulated rates. The last of Dynegy’s subsidiaries emerged from bankruptcy protection in November 2013, after a collapse in wholesale electricity prices drove several years of losses for the independent power producer.

The deal extends Dynegy’s sales in PJM Interconnection LLC, the largest U.S. wholesale power market, and in New England, where cold weather and a fuel shortage caused electricity prices to surge in January. The PJM market extends from New Jersey and Virginia in the east to Illinois in the west.

“The addition of these portfolios transforms Dynegy by adding considerable scale in the PJM and New England markets,” Chief Executive Officer Robert Flexon said in the statement.

The announcement was made before the start of regular trading on U.S. markets. Dynegy climbed 21 percent to $35.88 at 8:55 a.m. in New York. Duke gained 0.3 percent to $73.26.

With the acquisition, Dynegy would rival Calpine Corp. as the largest U.S. independent power producer by capacity with about 26,000 megawatts of generating capacity each. NRG Energy Inc. owns plants capable of producing 52,466 megawatts. A megawatt can power about 800 average U.S. homes.

Dynegy sees free cash flow of $4 a share next year, up from $1.25 this year, Flexon said on a conference call today. The company may use the cash to buy back stock, he said.

“First look says a positive,” Brandon Blossman, a utility analyst for Tudor, Pickering, Holt & Co. in Houston, wrote today in a note to clients. “Near term deal metrics look very good.”

Flexon has been rebuilding Dynegy through acquisitions since guiding the company through bankruptcy. His goal is to profit by squeezing costs and improving prices from plants dropped by regulated utilities that are abandoning more-risky wholesale power.

Charlotte, North Carolina-based Duke will get cash for its plants. Energy Capital, formed in 2005 by former Goldman Sachs Group Inc. partner Doug Kimmelman, will get $3.45 billion including $200 million in Dynegy stock, according to the statement. Dynegy will assume no corporate debt in either transaction, said Katy Sullivan, a company spokeswoman.

Duke announced Feb. 17 it would sell the Midwest wholesale business. The plants are no longer a strategic fit as the company pursues mores dependable profit from regulated utilities, Chief Executive Officer Lynn Good said at the time.

Most of the generating capacity Dynegy is buying, 5,053 megawatts, consists of gas-fueled plants. Another 3,793 megawatts of capacity comes from coal-burning plants that are “environmentally compliant,” Dynegy said.

Lazard Ltd. and Credit Suisse Group AG advised Dynegy on both transactions. Morgan Stanley was lead adviser on the Energy Capital deal and Goldman Sachs Group Inc. advised on the purchase from Duke, Dynegy said. Citigroup Inc. and Morgan Stanley advised Duke.