Exelon, the nation’s biggest nuclear power generator and one of its largest electric utilities, announced Thursday that it would acquire Constellation Energy Group for shares of stock worth approximately $7.9 billion.

The Chicago-based Exelon would become the nation’s second-biggest residential electrical utility, with 6.6 million customers in Illinois, Pennsylvania and Maryland, and the biggest merchant of electricity on competitive markets. It would increase its nuclear power capacity to 19,000 megawatts.

Constellation is owner of Baltimore Gas and Electric and a fleet of coal- and natural-gas-fired power plants. A Constellation joint venture with Electricite de France owns nuclear plants at three locations, including Calvert Cliffs, Md.

Under the terms of the deal announced Thursday, Constellation’s shareholders will receive 0.930 shares of Exelon common stock in exchange for each share of Constellation common stock. Based on Exelon’s closing share price on Wednesday, Constellation shareholders would receive a value of $38.59 per share. Constellation’s shares had jumped more than 11 percent in after-hours trading Wednesday to about $38 a share, on top of a 4 percent increase during regular trading.

The deal, which includes a $250 million package of benefits for Maryland, will require a slew of regulatory approvals. The benefits package includes $50 million to develop 25 megawatts of renewable energy, a $100 credit for BGE customers within 90 days of closing the merger, a guarantee that there will be no cuts in BGE staff for at least two years, and a pledge to maintain Constellation’s $10 million per year of charitable donations for at least a decade. Exelon would also give $10 million to building electric car infrastructure and $4 million to the state’s energy efficiency program.

Exelon also said that its commercial retail and wholesale electricity business and its renewable energy business would be headquartered in Baltimore and that the merged company would build or renovate a building to meet Leadership in Energy and Environmental Design (LEED) standards.

The acquisition would mark a crowning achievement for Exelon chief executive John W. Rowe, who said he would retire on completion of the deal. His No. 2, Christopher M. Crane, would become chief executive of the combined company. Constellation’s chief executive, Mayo A. Shattuck III, would become executive chairman of the company.

The new board would include 12 directors from Exelon and four from Constellation.

An acquisition could end several years of controversy for Shattuck, who delved into risky hedging activities, tried to merge with a Florida utility, did battle with Maryland legislators and regulators, then angered Constellation partner and major shareholder EDF.

The EDF dispute took place last year, when Constellation withdrew from a proposal for federal loan guarantees to build a new nuclear reactor at Calvert Cliffs; Obama administration officials said they were on the verge of granting the request. EDF said it would still pursue plans for a new nuclear reactor there.

A merger of Constellation and Exelon would also continue a trend toward consolidation in the utility industry.

Last week, Arlington County-based AES announced a $4.7 billion acquisition of DPL, the parent company of Dayton Power & Light.

With tepid growth in electricity usage, acquisitions offer a way for big utilities to grow.

But many takeovers have been foiled by regulatory obstacles. An earlier proposed merger of Constellation and the Florida-based utility now known as NextEra Energy ran into widespread opposition in Maryland. The deal was eventually dropped.

Exelon, itself the product of a merger in 2000, has failed at two takeover attempts, including a hostile bid for NRG Energy that it abandoned in 2009. At the time, Exelon chief executive Rowe said he would seek other acquisition opportunities.

The merger with Constellation requires the approval of shareholders, as well as the Federal Energy Regulatory Commission (FERC), Nuclear Regulatory Commission (NRC), Maryland Public Service Commission, the New York Public Service Commission, the Public Utility Commission of Texas, and other state and federal regulatory bodies.

Rowe has said that while Exelon’s nuclear plants are highly profitable, it does not make economic sense for companies to build new ones when natural gas prices are low and when Congress is unwilling to make companies pay for carbon dioxide emissions.

Many of Constellation’s coal plants are aging. A Citigroup report Wednesday said that Environmental Protection Agency regulations could force Constellation to invest in expensive scrubbers or retire some facilities.