Regulators on Wednesday approved a $6.8 billion merger between Pepco Holdings Inc. and Exelon Corp., forming the nation’s largest publicly held utility.

The District of Columbia Public Service Commission voted 2-to-1 to approve the deal, handing a surprise to analysts who expected the proposal would crumble after regulators rejected a similar proposal last month.

Exelon is the largest U.S. operator of nuclear power plants, with more than 19,000 megawatts of nuclear power spread across six states: Illinois, Maryland, Nebraska, New Jersey, New York and Pennsylvania. The utility also operates more than 12,000 megawatts of coal, oil and natural gas plants and smaller supplies of hydroelectric and solar power. Pepco, a 120-year-old utility, delivers electricity to more than 815,000 customers in Maryland and D.C.

The Pepco-Exelon merger had already won approval from Delaware, Maryland, New Jersey, Virginia and the Federal Energy Regulatory Commission. Approval from the D.C. commissioners was the last remaining hurdle.

In voting to approve the merger, the commission said it found the deal was “in the public interest” and “will benefit ratepayers and the District,” according to a statement.

Benefits of the deal include a $72.8 million Customer Investment Fund, including $11.25 million in funds for energy efficiency and conservation projects for low-income residents. The fund also carves out $21.55 million for pilot projects to modernize the electric grid and accommodate rooftop solar projects and battery storage systems.

“These benefits, among others, would not be available to District ratepayers if the merger is not approved,” the commission said.

Analysts from Guggenheim Securities LLC and other investment firms had said they expected the D.C. commission to reject the Pepco-Exelon merger, given previous opposition.

"They could reject the deal again since there is no consensus among parties on settlement conditions. This is a strong likelihood, in our view,” Shahriar Pourreza, an analyst with Guggenheim, wrote in a note ahead of the merger.

In February, commissioners rejected a $78 million plan negotiated by Mayor Muriel Bowser that would have held down residential rates for the next four years. In the plan approved Wednesday, the money Bowser wanted to cushion residential customers could instead go to credits for businesses or the federal government, the Washington Post reported.