[Editor's note: This article was updated at 11:15 a.m. April 30.]

Exxon Mobil Corp. on April 30 topped Wall Street quarterly earnings estimates with its first profit in five quarters, boosted by higher oil prices and strong chemicals margins.

Earnings from Exxon and rivals this year have been rising with crude oil prices, up by one-third this year, as a global oil surplus from the pandemic drains and fuel demand recovers. The swing to a profit comes as European rivals also posted results that exceeded pre-pandemic levels.

Quarterly results show Exxon’s deep cost cuts have allowed it to turn the corner on last year’s historic annual loss and deliver strong cash flow need to reduce debt. Exxon is fighting a hedge fund’s over board seats and its fossil fuel direction.

Net income was $2.73 billion, or 64 cents per share, in the first quarter, compared with a loss of $610 million, or 14 cents per share, a year earlier.

Adjusted earnings of 65 cents per share beat analyst expectations of 59 cents, according to Refinitiv IBES data.

Improving economies are helping drive product demand, CEO Darren Woods said on a call with analysts.

“Thanks to our efforts over the last few years, we are a stronger company with an improving outlook,” Woods said.

Chemical earnings were the largest factor in first quarter results with a profit nearly 10 times the year-ago level and the strongest in at least five years. That business has been soaring on high prices and demand for plastics.

Exxon’s deep cost cutting also boosted earnings. Exxon's capital spending fell to $3.1 billion, the lowest in nearly two decades. Expense cuts helped lift cash flow to $9.3 billion, the highest since 2018.

When the company set spending plans in November, it was “difficult to call what this year was going to look like,” Woods said in an interview.

“We tended to back-end load the plan recognizing that the economic recovery we anticipated would occur over the course of 2021 and gain momentum as we headed in to the second and third quarters,” Woods said.

It still expects to spend near the low end of its $16 billion to $19 billion estimates for new projects, he said.

The Irving, Texas-based company last year cut $8 billion from operating expenses and vowed to reduce operational spending by another $3 billion by 2023.

Shares, which have climbed 35% since January, were down 1.7% at $57.96 on April 30 alongside oil prices and other oil and gas companies.

Exxon covered its spending and dividend with cash flow for the first time since the third quarter of 2018.

Net debt declined for the first time in several quarters, said analyst Biraj Borkhataria of RBC Europe Ltd.

But free cash flow yield, estimated at 9% this year, “remains well below peers even in a bullish macro scenario,” Borkhataria said.

Exxon’s largest business, E&P, earned $2.6 billion in the first quarter on higher oil prices, compared with a profit of $536 million a year earlier.

Its chemicals business posted the best quarter since at least 2012, earning $1.4 billion on better margins, up from a $144 million profit a year ago.

Exxon’s chemicals business was once a profits engine but had faltered prior to the pandemic. The company appears to be “righting the ship,” said Peter McNally, analyst at Third Bridge Group.

Refining lost $390 million, compared with loss of $611 million last year, on winter storm shutdowns impacts and fuel demand.

With product sales down 8% from last year, Exxon needs “volume uptick to get any kind of profit recovery” in refining, McNally said.