Energy companies Contango Oil & Gas Co. (NYSE: MCF) and Crimson Exploration Inc. (Nasdaq: CXPO) are merging in a deal valued at $390 million, in the latest energy transaction.

Through the all-stock deal, Crimson will become a subsidiary of Contango. Under the terms of the transaction, each share of Crimson’s stock will be converted into about 0.08 shares of Contango stock, which will give Crimson shareholders a 20.3 percent stake in the combined company. Contango is assuming $244 million in Crimson’s debt as part of the agreement.

Houston-based Contango explores for, develops and produces natural gas and oil in the shallow waters off the Gulf of Mexico. Contango’s shares closed at $38.50 on April 29, before the deal news. 

Crimson, also based in Houston, focuses on acquiring, developing and exploring for crude oil and natural gas in the onshore Gulf Coast region. The company’s stock closed at $2.95 on April 29, before the merger was announced. The deal values Crimson shares at $3.19.

The transaction, which will give the company both onshore and offshore presence, is expected to close in the third quarter.

Morgan Lewis & Bockius LLP served as Contango’s legal counsel for the deal.

M&A has continued to flow from the energy sector. Recent deals include Atlas Pipeline Partners LP’s (NYSE: APL)’s decision to buy Teak Midstream LLC for $1 billion, Midstates Petroleum Co. Inc.’s (NYSE: MPO) acquisition of properties in the Anadarko Basin in Texas and Oklahoma for $620 million and Penn Virginia Corp.’s (NYSE: PVA) purchase of properties in the Eagle Ford shale play for $400 million.