A plunge in global oil prices in April due to the COVID-19 pandemic had hammered refiners, but demand for gasoline and other products is now recovering from the collapse.
The demand recovery helped Marathon post a smaller adjusted loss of $868 million, or $1.33 per share, for the second quarter, compared with analysts' estimate of a $1.75 loss.
Shares of the company rose 6% after Marathon said it would use the proceeds from the Speedway deal to strengthen its balance sheet and return cash to shareholders. Investors had been worried about the refiner's large debt due over the next five years.
About half of the company's $32 billion in total debt is outstanding through 2025, according to Refinitiv Eikon data, and it generated just $172 million in operating cash flow in the second quarter.
The Speedway sale, agreed at a price just a billion below what Seven & i reportedly rejected in March, is one of the biggest this year and is expected to close in the first quarter of 2021.
Last week, rival refiners Valero Energy Corp and Phillips 66 posted better results than analysts had feared, citing a recovery in fuel demand.
However, analysts warn that the uptick in demand is under threat from a resurgence in cases across the United States.
"Demand for our products and services continues to be significantly depressed, particularly across the West Coast and Midwest," Marathon Chief Executive Michael Hennigan said.
(Reporting by Shradha Singh in Bengaluru; Editing by Shinjini Ganguli)