Spanish energy group Repsol is selling a 25% stake in its oil and gas exploration division to U.S. fund EIG for $4.8 billion, building up a warchest for renewables projects as the energy industry moves to a lower-carbon future.

The deal, first reported by Reuters earlier this year, values the whole business at $19 billion including debt, and may lead to a U.S. stock market listing of a stake in the unit after 2026, Repsol said in a statement.

The process started with an unsolicited offer from EIG, Reuters reported in June, sending Repsol's shares to a 14-year high.

Shares rose after an announcement on Sept. 7 before falling 1.8% by 7:46 GMT. They nonetheless outperformed the European oil and gas index, which was down 2.3%.

The company plans to invest the cash in areas like wind farms and renewably produced hydrogen, in line with other European oil and gas companies which are facing pressure from shareholders and regulators to cut their planet-warming carbon emissions.

Repsol will retain control of the so-called upstream unit. Chief Executive Josu Jon Imaz said the deal would allow it to speed up its decarbonization drive, and that EIG was also "prepared to invest with us in the future of upstream."

"We need to reduce the carbon footprint of our products, but we will continue to need oil and gas for many more years. Society will have a problem if we don't produce them," he said, adding, "This is a transition, an orderly transition."

The group has pledged to plough more than one third of its investments by 2025 into low-carbon projects and ensure its products emit no more carbon than can be absorbed by natural sinks like forests, or systems like carbon capture, by 2050.

Based in Washington DC, EIG specializes in private investments in energy and energy-related infrastructure. Last year, it led a consortium that spent $12.4 billion on a 49% stake in oil giant Saudi Aramco's pipelines business.

Repsol's total market value has risen almost 30% this year after COVID-19 brought it crashing to multi-year lows, and is currently around 19.6 billion euros (US$19.4 billion).

Oil and gas firms' upstream divisions are typically complex, and Repsol has been working to simplify a structure of more than 100 individual units.

It has disposed of stakes in exploration businesses in several countries, and sold its Russian assets to Gazprom Neft in January.

Investment bank PJT Partners advised Repsol on the deal.