Nearly eight months after its hopes of acquiring the electricity transmission and distribution arm of bankrupt Energy Future Holdings appeared to be dashed, NextEra Energy (NEE) - Get Report has returned to claim victory.

The Juno Beach, Fla., clean energy company announced on Friday that it has reached a deal to acquire 100% of the reorganized equity in EFH, including its 80% interest in nonbankrupt indirect subsidiary Oncor Electric Delivery. The statement said the deal implies a total enterprise value of $18.4 billion.

The agreement with EFH will be part of an overall reorganization plan that will allow the Dallas company to exit from bankruptcy protection. The private equity-backed debtor had yet to file any court documents regarding the deal with the U.S. Bankruptcy Court for the District of Delaware in Wilmington as of Friday morning.

NextEra had pushed to acquire Oncor last year, saying in November it was prepared to close a transaction that would pay in full or otherwise leave unimpaired all creditors of Energy Future Intermediate Holding Co. LLC -- the EFH unit that is Oncor's majority owner -- extinguish all third-party debt above Oncor and improve the credit ratings of Oncor and entities above it. NextEra first expressed interest in buying Oncor in June 2014.

Nevertheless, Judge Christopher Sontchi of the Delaware court on Dec. 3 confirmed a reorganization plan for EFH that would have sold Oncor to affiliates of Hunt Consolidated and a consortium of investors for $18 billion. The debtor's other arm, Texas Competitive Electric Holdings, would have been spun off to first-lien lenders in a tax-free transaction. TCEH owns utility TXU Energy and Luminant, an electricity generation, mining and wholesale energy trading and power marketing company.

The consortium was to inject roughly $7.1 billion in equity and $5.1 billion in debt in a deal approved Sept. 18, but the sale collapsed in April after certain investors pulled out. Other members of the consortium aside from Hunt Consolidated included Anchorage Capital Group, Arrowgrass Capital Partners, Avenue Capital Group, BlackRock (BLK) - Get Report , Centerbridge Partners, GSO Capital Partners and the Teacher Retirement System of Texas.

In recent months, names of various rumored bidders surfaced.

Other bidders included billionaire Warren Buffett's Berkshire Hathaway (BRK.A) - Get Report and Edison International (EIX) - Get Report , and they could still come in with a higher offer along with Ray Hunt's group, a source close to the situation said.

According to Friday's statement, NextEra Energy would fund $9.5 billion, largely for repayment of EFIH debt, including its $5.4 billion debtor-in-possession loan, while other creditors would be paid in cash and in NextEra common stock. All EFH and EFIH debt would be extinguished.

Under the deal, which NextEra anticipated would be completed in the first quarter of 2017, EFH could solicit bids from third parties before the bankruptcy court approved the deal. If EFH moved forward with another deal before confirmation, NextEra Energy would receive a $275 million termination fee.

The deal is subject to bankruptcy court approval, as well as approval by the Public Utility Commission of Texas, the expiration or termination of the waiting period under the Hart-Scott-Rodino Act, the Federal Energy Regulatory Commission and other customary conditions and approvals, the statement said.

"We are pleased to have reached a definitive agreement to acquire EFH's [80%] indirect interest in Oncor," NextEra Energy chairman and CEO Jim Robo said in the statement. "We are incredibly impressed by Oncor's management team and its employees, and we are committed to retaining the Oncor name, its Dallas headquarters and local management. NextEra Energy shares Oncor's strategy of making smart, long-term investments in transmission and distribution to continue to deliver affordable, reliable electric service to its customers."

In a separate deal, also announced Friday, NextEra Energy Resources, the competitive energy subsidiary of NextEra Energy, said it would sell its ownership interest in its Marcus Hook, Pa., generating assets to an affiliate of Starwood Energy Group Global for $760 million. Starwood Energy is an energy infrastructure investment firm.

The assets include two natural gas-fired power plants, the 790-megawatt combined-cycle Marcus Hook Energy Center and the 50-megawatt simple-cycle Marcus Hook 50 Energy Center, the statement said.

Barclays and Simpson Thacher & Bartlett are advising NextEra Energy Resources, while Morrison & Foerster is legal counsel to Starwood Energy.

The twin deals for NextEra come after a $4.3 billion merger with Hawaiian Electric Industries (HE) - Get Report was terminated earlier this month following rejection of the deal by the Hawaii Public Utilities Commission.

NextEra's stock, which trades on the New York Stock Exchange, was up 0.6% on Friday morning to $128.20.

Energy Future Holdings filed for Chapter 11 protection on April 29, 2014, to implement a restructuring that later was scrapped.

Sontchi in May allowed EFH to bifurcate its plan proceedings after the collapse of the confirmed plan. The judge on June 17 signed an order approving the third amended disclosure statement outlining the plan of TCEH and EFH shared services debtors, with a confirmation hearing set for Aug. 17. The remaining debtors -- the ones related to the NextEra deal -- were set to seek approval of a disclosure statement for their own plan on July 21, but an order never was entered.

The new TCEH plan would either spin off the company to holders of its first-lien debt or allow a taxable sale or exchange of the company.

EFH, formerly known as TXU, was formed after a consortium of private equity firms, including Kohlberg Kravis Roberts (KKR) - Get Report , TPG Capital and Goldman Sachs (GS) - Get Report , acquired the company for about $32 billion in equity on Oct. 10, 2007, assuming $13 billion in debt.

Ahmad Masud and Pierre Bosse at Credit Suisse Securities and Ray Wood and Jason Satsky of Bank of America Merrill Lynch are NextEra's lead financial advisers. Its other advisers include Tom Widener at Deutsche Bank Securities; JPMorgan Securities; UBS Securities; Hugh Babowal, Eric Fornell and Aaron Smith at Wells Fargo Securities; and legal adviser William Greason of Chadbourne & Parke.

A Kirkland & Ellis team headed by Andrew Calder, Kevin Morris and John Pitts is advising EFH. James Sprayregen, Edward Sassower, Marc Kieselstein, Chad Husnick and Steven Serajeddini lead Kirkland's team providing counsel on the bankruptcy.

EFH's other advisers include an Evercore Partners team led by William Hiltz, David Ying, Stephen Goldstein, Brendan Panda and Sesh Raghavan and debtor counsel Mark D. Collins, Daniel J. DeFranceschi and Jason M. Madron of Richards, Layton & Finger. --Claire Poole contributed to this report.

This article was originally published by The Deal, a sister publication of TheStreet that offers sophisticated insight and analysis on all types of deals, from inception to integration. Click here for a free trial.