After nine hours of wrangling over measures to counter high energy prices, the EU countries have agreed to buy gas together.

"I welcome the fact that we will use our joint negotiating power," said Commission President Ursula von der Leyen after the summit on Friday evening.

"Instead of outbidding each other and driving up prices, we will pool our demand." For pipeline gas, the EU represents about 75 percent of the market.

"We have enormous purchasing power," said von der Leyen.

There was initially no agreement on a direct cap on gas prices, such as those demanded by Italy, Portugal, Spain or Greece.

Countries like Germany and the Netherlands opposed such market intervention.

Demands by Spain to separate the electricity price from the gas price - since they are linked by a price mechanism - were also rejected.

Spain is particularly affected by the high prices.

Call for Commission proposals to counter high electricity prices

The declaration now states that the countries and the Commission should discuss with stakeholders in the energy sector whether and how, among other things, price caps or tax rebates could help to lower the price of gas and combat its "contagion effect" on the electricity markets.

At the same time, the heads of state and government are calling for proposals from the Commission to tackle high electricity prices, safeguard the integrity of the internal market and create incentives for the energy transition.

The states are already hoping for a price advantage through joint gas purchases on a voluntary basis.

One wants to use the "collective political and economic weight of the European Union" to push down prices in purchase negotiations, according to the statement.

According to the Commission's plans, a team under it could negotiate with suppliers with the support of the Member States - similar to the joint purchase of corona vaccines.

According to the statement, the joint purchases should also be open to Ukraine, Moldova and Georgia, as well as the countries of the Western Balkans.

Countries also backed a Commission law proposal on mandatory gas reserves to stockpile for this winter.

This must now be negotiated and approved by the EU countries and the European Parliament.