HOUSTON, July 29 Reuters Exxon Mobil Corp on Friday posted its biggest quarterly profit ever on the back of soaring energy prices and as it kept a tight rein on spending.

The top U.S. oil producer reported secondquarter net income of 17.9 billion, or 4.21 per share, an almost fourfold increase over the 4.69 billion, or 1.10 per share, it earned in the same period last year.

Oil and natural gas prices have scaled multiyear highs this year as Western sanctions against major exporter Russia squeezed an already undersupplied global market. Margins for making fuels like gasoline and diesel surged worldwide, boosting the profits of oil giants, including European majors Shell and TotalEnergies, both of which reported results on Thursday.

Exxon39;s results also beat its best quarter of 2008, when Brent crude oil prices peaked at 147 per barrel, and its bestever quarter reached in 2012, when the company earned 15.9 billion, largely due to asset sales in Japan and taxrelated items.

Exxon39;s firstquarter profits led U.S. President Joe Biden last month to say the company and other oil majors were capitalizing on a global supply shortage to fatten profits. Exxon, he said, was making more money than God after posting its biggest quarterly profit in seven years.

Exxon has been using extra cash to pay down debt and raise distributions to shareholders. It maintained its 88centpershare dividend for the third quarter.

The company earlier this year more than doubled its projected…