(Reuters) - U.S. refiner Marathon Petroleum Corp MPC.N beat estimates for quarterly profit on Thursday, benefiting from better-than-expected earnings from its refining segment as well as higher sales in its gas stations business.

FILE PHOTO: A Marathon Petroleum banner covers an Andeavor sign outside the El Paso refinery following a closed $23 billion deal after the Ohio-based Marathon bought the Texas-based company, forming one of the largest global refiners in El Paso, Texas, U.S., October 1, 2018. REUTERS/Julio-Cesar Chavez

Refiners in the United States have suffered from a lack of low-cost heavy crude in a market that has been hit by sanctions on Venezuela and Iran, and production cuts from Canada’s Alberta province and OPEC members.

However, industry analysts at Simmons Energy and Credit Suisse said Marathon had managed to keep its operating costs per barrel lower than expected.

The company’s earnings from its refining and marketing segment fell 11.6% to $906 million, but beat analysts’ estimates of $623.5 million, according to IBES data from Refinitiv.

Shares of the company, which posted a surprise loss in the preceding quarter owing to lower-than-expected refining margins, were up 3% in early trading on Thursday.

“One-times that drove the 1Q19 miss are now firmly in the rear view mirror and MPC looks all set to capture its synergy benefits,” Credit Suisse analyst Manav Gupta said.

Marathon’s refineries ran at an average utilization rate of 97% in the quarter, compared with 100% in the year-ago quarter.

Marathon refined 3.1 million barrels per day, 1.1 million bpd higher than a year earlier. The company said the increase was primarily due to the addition of Andeavor, which it bought in October.

The company, which said it continued to focus on optimizing its portfolio that could include asset divestitures, expects to refine 3.05 million bpd at an operating cost of $5.90 per barrel

in the third quarter.

Net income attributable to the Findlay, Ohio-based company rose 4.8% to $1.11 billion in the quarter ended June 30, as it was also benefited from a more than three-fold rise in its retail segment earnings.

Excluding items, it earned $1.73 per share, beating analysts’ average estimate of $1.32.

Total revenue and other income rose to $33.69 billion from $22.45 billion.

On Thursday, HollyFrontier Corp HFC.N also posted a better-than-expected profit, joining bigger rivals Valero Energy Corp VLO.N and Phillips 66 PSX.N which reported their results last week.