ExxonMobil Corp. posted its biggest earnings surprise in at least a decade as output from oil wells surpassed expectations and refining margins soared amid lower crude prices.

Per-share profit was 41% higher than the average of 21 analysts’ estimates compiled by Bloomberg, the biggest margin since at least 2004.

As lower oil prices drained profit, net income in the first quarter dropped to $4.94 billion, or 1.17 cents a share, from $9.1 billion, or $2.10, a year earlier, the Irving, Texas-based company said in a statement Thursday. Excluding some items, the per-share result was 34 cents higher than the 83-cent average analysts’ estimate.

As the world’s biggest energy producer by market value, ExxonMobil has been in the vanguard of curbing expenses and reassessing costly new projects to cope with global oil prices that fell to about $45 a barrel at the start of the year. A glut of crude from new wells in North America, the Persian Gulf and Africa swelled U.S. inventories to the highest since the 1930s, said Mara Roberts of Fitch Group Inc.’s BMI Research.

“The rig count has fallen significantly but oil production has proven more resilient than most thought it would be,” said Roberts, BMI’s North American oil and natural gas analyst. “This all points to a slowdown in development” of new oil fields “but it’s not just going to grind to a halt.”

The plunge in international crude hit ExxonMobil as the company already was grappling with U.S. and European Union sanctions against Russia that trapped as much as $1 billion of Exxon investments in the country and cast doubt on its long-term growth plans. As Chairman and CEO Rex Tillerson entered the 10th year of his tenure, Exxon was hobbled by an exploration failure rate that climbed to 39 percent in 2014 from 33% a year earlier.

Oil Rout

Brent crude, the benchmark for most of the oil traded internationally, averaged $55.13 a barrel during the first quarter, down 49% from $107.87 a year earlier. In the U.S., the source of almost one-third of the company’s global gas supplies, the fuel averaged $2.809 per million British thermal units during the quarter, 40% less than in the year- earlier period.

Tillerson, a 63-year-old University of Texas-trained engineer who’s spent his entire career at ExxonMobil, was ahead of the industry curve in slowing spending. Even as crude topped $115 a barrel last year, Tillerson was overseeing a 9.3% reduction in spending on drilling, refineries and chemical plants. The cut expanded to 12% for 2015, when Exxon is scheduled to spend $34 billion on capital projects.

Rival Producers

Tillerson said earlier this month that industry observers anticipating an imminent rebound in crude prices will be disappointed. Low prices appear likely to persist “for the next couple of years” at least, he said at the IHS CERAWeek conference in Houston on April 21.

ExxonMobil’s profit announcement followed BP Plc and Total SA, which disclosed estimate-beating results on April 28.

U.K.-based BP’s profit adjusted for one-time items and inventory changes was $2.6 billion, more than double the $1.2 billion average estimate from analysts. Total, the No. 3 European oil producer after Royal Dutch Shell Plc and BP, earned $2.6 billion during the January-to-March period, exceeding the $2.17 billion average estimate.