Rapidly recovering demand after COVID-19 lockdowns propelled energy prices to highs that have been driven to record levels by Russia's invasion of Ukraine, increasing profits for many of the world's oil companies.

Repsol's adjusted net income hit 2.12 billion euros ($2.17 billion) in the quarter, up from 488 million euros in the same period last year. Brent crude oil prices rose 65% in the period while Henry Hub gas prices soared by 157% on average.

Repsol's result overshot the expectations of analysts polled by the company and who gave a consensus net profit forecast of 1.94 billion euros.

Its performance prompted the company to announce that it will increase the size of its share buyback plan and now aims to reduce share capital by 75 million shares instead of a previous target of 50 million.

Between January and June, a little more than half of the company's adjusted net income came from its international business, which mainly conducts hydrocarbons exploration and production.

The rising value of hydrocarbons kept in strategic reserves in Spain added 1.2 billion euros to Repsol's net profit in the first half.

However, in a sign of changing approaches to the way the world manages its energy sources, Repsol made an impairment provision of 1.84 billion euros on its refining business, citing the "volatile international context and increased regulatory pressure on fossil fuels in the European Union".

($1 = 0.9782 euros)

(Reporting by Isla Binnie; Editing by David Goodman)

By Isla Binnie