Federal energy regulators have approved the sale of Pepco Holdings to Chicago-based Exelon, which moves the proposed $6.8 billion merger a step closer to creating the Mid-Atlantic’s largest gas and electricity provider.

The proposed merger, which was endorsed Thursday by the Federal Energy Regulatory Commission, still must be cleared by the U.S. Department of Justice and by regulators in Maryland, Delaware, New Jersey and the District of Columbia.

The deal has been approved by Pepco shareholders and by the boards of directors at both companies. The Virginia State Corporation Commission signed off on the transaction last month.

Some analysts said the approval process could get rocky, especially in Maryland, which historically has had the toughest regulatory environment.

“By no means is it a slam dunk, but I would think the market agrees this deal will get done,” said Andy Pusateri, a utilities analyst with Edward Jones. “I think, ultimately, Exelon and Pepco would be willing to make further concessions or asset sales to get the deal approved.”

The companies hope to close the merger, which was announced last April, in the second or third quarter of 2015. Exelon has proposed acquiring Pepco in an all-cash transaction that valued Pepco at a 24.7 percent premium above the company’s share price prior to the announcement.

Exelon is acquiring a gas and electric transmission and distribution company that is one-fifth its size. Pepco, which began as a streetcar company in the late 19th century, no longer generates its own electricity and instead buys it from others. Pepco has more than 2 million customers in an arc stretching from Washington and its Maryland suburbs east to the Delaware shore and north to New Jersey.

Exelon delivers gas and electricity to over 7.8 million customers, through BGE in Maryland, PECO in southeast Pennsylvania and ComEd in northern Illinois.

Exelon generated $24.9 billion in revenue last year from business in 48 states. Its nuclear fleet is the largest in the United States, with 23 reactors in 13 locations across Illinois, Maryland, Nebraska, New Jersey, New York and Pennsylvania.