Royal Dutch Shell Plc (RDS.A - Get Report) posted stronger-than-expected third-quarter earnings Thursday thanks to the ongoing rise in global oil prices, rounding out the best collective quarter for western oil majors in three years.

Shell reported "clean" net income of $4.1 billion, or 47 cents share, for the three months ending in September, topping analysts' forecasts and rising 47% from the same period last year.  The group's downstream unit, which focuses on refining and marketing, was expected to see a slump related to closures from Hurricane Harvey and costly fires in Europe, but earnings nonetheless rose 28% from last year to $2.6 billion and topped the $2.529 billion tally from last quarter.

"Shell's three businesses all made resilient contributions to this strong set of results. Upstream generated almost half of the $10 billion cash flow from operations excluding working capital this quarter, at an average Brent oil price of $52 per barrel, and this was complemented by good cash contributions from our growing Integrated Gas business and from Downstream," said CEO Ben Ben van Beurden. "This competitive performance is further evidence of Shell's growing momentum, and strengthens my firm belief that our strategy is working."

Collectively, the five biggest western oil companies -- BP plc  (BP - Get Report) , Shell, Chevron Cprp.  (CVX - Get Report) , Exxon Mobil Corp.   (XOM - Get Report)  and Total SA (TOT - Get Report) -- have had their best quarterly earnings since 2014, with bottom lines boosted by cost cuts and surging crude prices.

Brent crude prices averaged around $52 a barrel for the three months ending in September, according to OPEC data, compared to around $46 over the same three-month period last year.

Shell shares were marked 0.11% higher at 2,361 pence each in London Thursday and have gained around 10.7% over the past three months. That lags the 13% three-month advance for rival BP and the 11.5% gain for France's Total. 

Earlier this week, BP posted a sharp rise in third quarter profits, thanks to a recovery in global oil prices, and said it would buyback shares in the fourth quarter even as it held its dividend in check.

BP said its replacement cost profits doubled to $1.865 billion in the three months ending in September over the same period last year, a figure that beat analysts' forecast of 1.58 billion. However, while the group said it would buyback stocks in the current quarter, it held its 10 cents per share.

The group said it will buyback shares this quarter in order to offset the paying of dividends in script, or new shares, which dilute value of shareholders over time. BP said the buybacks wouldn't fully compensate for this, however, but would factor in things like changes in the oil price environment and the group's overall financial position.

More of What's Trending on TheStreet: