The two companies combined are buying back $8 billion in shares in the third quarter after recording their respective highest quarterly profits while keeping their dividends steady, which might disappoint some investors.

Benchmark Brent crude oil futures have risen more than 140% in the past twelve months, averaging around $114 a barrel in the quarter.

High crude prices normally weigh on refining margins, but tight refined fuel supply supported record profitability in the second quarter, with Shell's refining margin virtually tripping to $28 a barrel.

Benchmark European natural gas prices and global liquefied natural gas prices were on average at all-time highs in the quarter.

Boosted by a record quarterly profit of $11.5 billion, Shell is buying back $6 billion of its own shares by late October, it said on Thursday, on the back of an $8.5 billion buyback scheme finished in the first half.

While this is in excess of the company's guidance for shareholder returns of up to 30% of cash from operations, Shell did not raise its dividend from its current level of 25 cents a share, a 4% annual increase after a 60% cut during the pandemic.

TotalEnergies, with a 9% rise in quarterly profit to $9.8 billion, guided it would buy back $2 billion in the third quarter after purchasing $3 billion of its own shares in the first half of the year.

It had already announced a 5% yearly increase for its first quarterly dividend for this year to 0.69 euros per share, and said on Thursday it would keep that level for its second interim dividend of 2022.

"(TotalEnergies) has opted to maintain its buyback flat into (the third quarter), which may be disappointing to some investors given the current macro environment," RBC analyst Biraj Borkhataria said.

TotalEnergies' shares dipped 2.1% and Shell's shares were up 1.6% after the results announcement, having risen about 35% and 49% respectively in the past twelve months.

This compares with an index of European oil and gas firms gaining 1.6% in early trading.

The buybacks from Europe's two biggest oil and gas groups by market capitalisation came in the same week that Norway's Equinor raised its dividend and share buyback guidance for 2022 by 30% to a total of around $13 billion.

Smaller rival Repsol also announced a boosted share buyback programme on Thursday on the back of bumper profits, which doubled in the first half.

A rapid recovery in demand following the end of pandemic lockdowns and a surge in energy prices driven by Russia's invasion of Ukraine have boosted profits for energy companies after a two-year slump.

The strong profit windfall has allowed companies to reduce debt piles that grew sharply during the pandemic as well as boost returns to shareholders.

TotalEnergies' debt-to-capital ratio, or gearing, fell to below 10%, or half its level a year ago, from 12.5% in the first quarter, while Shell's dipped to 19.3% from 21.3%.

Eni, Exxon and Chevron are due to announce results on July 29 and BP on Aug. 2.

(Reporting by Shadia Nasralla; Editing by Jan Harvey)

By Shadia Nasralla and Ron Bousso