Royal Dutch Shell’s (NYSE: RDS.A) profits soared to a four-year high in the third-quarter, boosted by rising oil and gas prices as the company accelerated its giant $25 billion share buyback program.

Although the $5.6 billion quarterly profit slightly missed forecasts for a fourth quarter, investors took heart from a nearly 60% rise in Shell’s cash generation to $12.1 billion, as deep cost savings in recent years filtered through.

Excluding one-off charges, cashflow was the highest in 10 years at $14.7 billion, the company said on Nov. 1.

“Good operational delivery across all Shell businesses produced one of our strongest-ever quarters,” CEO Ben van Beurden said in a statement.

Shell’s A shares were down 2.4% by 0830 GMT, while the broader oil and gas index was down 1%.

The Anglo-Dutch company launched a three-year $25 billion share buyback program in July, making good on a promise to boost shareholder returns following the 2016 acquisition of BG Group, in a show of confidence in its cash generation and profit growth outlook.

Shell said it completed the first tranche of buybacks in October for $2 billion and was launching a second tranche on Nov. 1 of up to $2.5 billion by Jan. 28. “The main takeaway is the very strong cash generation,” Jefferies analyst Jason Gammel told Reuters. “Continued buybacks are a pretty strong catalyst for the shares.”

Shell’s shares have come under pressure in recent months after three disappointing quarterly results that raised concerns over its ability to meet the share buyback target on top of a $15 billion annual dividend payout, the world’s biggest.

Rising Oil

This year’s sharp rise in oil prices to a four-year high of around $85 a barrel (bbl) has boosted revenues for oil and gas companies.

British rival BP (NYSE: BP) on Oct. 30 reported its highest quarterly profits in five years, while French rival Total’s (NYSE: TOT) profits rose to their highest since 2012 as both firms ramped up production.

Shell’s net income attributable to shareholders in the quarter, based on a current cost of supplies and excluding identified items, rose 39% to $5.624 billion from a year ago. That compared with $4.691 billion in the second-quarter, and a company-provided analysts’ consensus of $5.766 billion.

Profits benefited from stronger oil and gas prices as well as bigger contributions from trading operations, though that was offset by weaker refining margins, tax and currency exchange effects.

CFO Jessica Uhl said Shell will stick to its $25 to $30 billion capex plans in the coming years despite rising waging and services costs.

“We are seeing wage inflation and inflation affecting the supply chain and we are actively managing it,” Uhl told reporters in a conference call.

Debt levels remained stubbornly high. Shell’s debt ratio versus company capitalization, known as gearing, declined to 23.1% in the quarter from 23.6% at the end of June.

Oil and gas production in the quarter fell 2% from a year earlier to 3.596 MMboe. Output was expected to rise in the fourth quarter due to lower maintenance, Shell said.