Hess (HES) agreed on Thursday to sell its retail business to Marathon Petroleum’s (MPC) Speedway for $2.6 billion, as the energy producer turns its attention to drilling.

According to Hess, its retail arm is the largest chain of company-operated gas stations and convenience stores along the East Coast.

Marathon said its 1,480 Speedway convenience stores, most of them in the Midwest, are part of the nation’s fourth-largest chain, just ahead of Hess. Marathon also sells its gasoline through 5,200 independent retail outlets.

The deal includes all Hess retail locations, as well as the company’s transport operations and shipper history on various pipelines.

Marathon said the combined business will become the largest U.S. chain of convenience stores by revenue. It will include about 2,700 locations and had 2013 pro forma revenue of more than $27 billion.

Marathon will buy Hess Retail Holdings for $2.37 billion in cash, in addition to $230 million of working capital. The transaction also includes $274 million in capital leases, bringing its total value to roughly $2.87 billion.

Marathon plans to fund the deal, which is expected to close late in the third quarter, with a combination of debt and cash on hand.

“This acquisition will be transformative for MPC and Speedway as it will significantly expand our retail presence from nine to 23 states through these premier Hess locations throughout the East Coast and Southeast,” Marathon president and CEO Gary Heminger said in a statement.

The Findlay, Ohio-based refiner plans to rebrand the Hess locations. During a conference call with analysts, Speedway president Tony Kenney said Marathon has a license agreement to use the Hess brand for three years until the gas stations and convenience stores can be converted to Speedway.

“It’s basically by agreement that we have to rebrand,” Kenney explained.

“We saw a lot of value in the Hess brand. But as you can appreciate, Hess is an ongoing, publicly traded company, and the colors and marquee are their brand,” Heminger said in response to an analyst’s question.

Hess has shed more than $10 billion worth of assets as part of an effort to transform itself into a pure-play exploration and production company. With the sale of its convenience stores and gas stations, Hess has largely completed that objective.

CEO John Hess said the deal with Marathon “marks the culmination of our strategic transformation into a pure-play exploration and production company.”

Proceeds from the sale will be used to support an increase in Hess’ share buyback program to $6.5 billion from $4 billion. Since August 2013, Hess has repurchased about $2.8 billion in stock.

Hess also said it will continue to sell its toy trucks, a longtime holiday tradition. Hess plans to sell a 50th anniversary edition this year at the retail outlets and online. Starting next year, the toy trucks will be sold exclusively online.

Shares of Hess rallied 1.7% to $90.80 in recent trading. Marathon was up 1% at $88.52.

Follow Matthew Rocco on Twitter @MatthewRocco