British oil giant BP rebounded to second-quarter profit on soaring energy prices, it said Tuesday, after a big loss linked to its Russia exit following Moscow's invasion of Ukraine.

Net profit hit $9.3 billion in the three months to June -- a threefold increase from the same period last year, the company said in a results statement.

That contrasted sharply with a $20.4-billion loss in the first quarter, when it took a vast writedown after its decision to leave Russia.

BP is the latest energy major to post bumper second-quarter earnings as oil and gas prices have surged in the wake of key producer Russia's invasion of Ukraine.

Prices have also spiked after countries lifted Covid pandemic lockdowns, spurring global energy demand.

British rival Shell revealed last week a fivefold surge in net profit to $18 billion while France's TotalEnergies raked in nearly $6 billion.

US majors ExxonMobil and Chevron last week logged record profits for the same period.

Turning to the third-quarter outlook, BP forecast Tuesday that oil prices will "remain elevated ... due to ongoing disruption to Russian supply, reduced levels of spare capacity and with inventory levels significantly below the five-year average".

And it warned gas prices will also remain "elevated and volatile" as Russia also squeezes European supplies in retaliation for Western sanctions over the assault on Ukraine.

The gas outlook was "heavily dependent on Russian pipeline flows or other supply disruptions", BP added.

BP is the latest oil major to report bumper profits as energy prices have soared
BP is the latest oil major to report bumper profits as energy prices have soared AFP / Ben Stansall

At the same time, BP posted a net loss of $11.1 billion for the first half of 2022.

That was sparked by a colossal charge of $24.4 billion, linked to a decision to exit its 19.75-percent stake in Russian energy group Rosneft.

That wiped out the overall benefit of high energy prices in the first half.

Gas prices, which skyrocketed in March after Russia launched its invasion of neighbouring Ukraine, surged last week after Moscow curbed crucial deliveries to Europe.

The market remains at its highest level since March after state-run Gazprom suspended gas deliveries to Latvia on Saturday.

Back in Britain, the government in May proposed a temporary windfall tax on BP and its UK rivals including Shell to help ease a cost-of-living crisis.

The proceeds will help to fund a multi-billion-pound support package for consumers hit by surging domestic electricity and gas bills.

UK annual inflation hit a new 40-year high of 9.4 percent in June on rising motor fuel and food prices, further eroding workers' wages.

Rocketing Chevron and ExxonMobil earnings also prompted calls for a windfall profits tax on the sector in the United States, which also faces the highest consumer price inflation in four decades.

A similar plea was made by left-wing politicians in France after TotalEnergies published its second-quarter earnings, but President Emmanuel Macron's government has opposed such a move.