(Reuters) -U.S. refiner Marathon Petroleum posted a first-quarter profit on Tuesday, compared with a loss last year, buoyed by strong refining margins as demand for fuel and refined products recovered to near pre-pandemic levels amid tight supplies.

Global fuel demand has recovered to near pre-COVID-19 levels, while Western sanctions on Russia following its invasion of Ukraine have tightened crude oil supplies worldwide.

In addition, refining capacity dropped worldwide during the pandemic, with several less profitable oil refineries closing operations in the last two years.

Overall product supplied, a proxy for demand, stood at 19.8 million barrels per day (bpd) in the fourth week of April, near pre-pandemic trends, according to U.S. Energy Information Administration data.

The company said its refining and marketing margins rose nearly 51% to $15.31 per barrel in the first quarter ended March 31.

Crude capacity utilization was 91%, resulting in total throughput of 2.8 million bpd, compared with an 83% utilization and total throughput of 2.6 million bpd a year earlier.

For the current quarter, the refiner expects throughput of 2.9 million bpd.

Refining and marketing segment’s profit from operations stood at $768 million, compared with a loss of $598 million last year.

The Findlay, Ohio-based refiner said net profit was $845 million, or $1.49 per share, for the quarter, compared with a loss of $242 million, or 37 cents per share, a year earlier.

Marathon’s results followed strong earnings from other energy companies, including Valero Energy Corp and Phillips 66.

(Reporting by Arunima Kumar in Bengaluru; Editing by Sriraj Kalluvila and Rashmi Aich)