Are the fortunes of the beleaguered energy sector turning around? ExxonMobil (XOM -1.23%) provided fuel for cautious optimism on that question with a better-than-expected first quarter, the results of which it published Friday morning.

The oil and gas giant earned $59.15 billion in total revenue during the quarter, which was 5% higher than the Q1 2020 tally. That was on production of 3.8 million oil-equivalent barrels per day. Although that metric was down by over 6% from the year-ago period, it was 3% higher on a quarter-over-quarter basis.

As for the bottom line, non-GAAP (adjusted) net income headed north, rising by a sturdy 21% year over year to 2.76 billion ($0.65 per share).

Toy oil rig and barrel atop various denominations of currency.

Image source: Getty Images.

Both headline items topped the admittedly modest expectations of the analysts following the stock. On average, they were estimating ExxonMobil would earn $54.60 billion on the top line, and net an adjusted, per-share profit of $0.59.

As the global economy gradually opens with the receding of the coronavirus pandemic in many parts of the world, increased demand is pushing up oil prices. Brent crude, for example, has risen by nearly 31% year to date.  

In the company's earnings release, it quoted its CEO Darren Woods as saying that the company's improved results also come from "our focus on structural cost reductions, while prioritizing investments in assets with a low cost of supply."

Although ExxonMobil stock fell by 2.9% during the normal share-trading window Friday afternoon, the bulls came back later and it crept higher (by 0.2%) in after-hours action.