The heads of state and government of the European Union have reached an agreement in principle in the energy dispute.

EU Council President Charles Michel wrote on Twitter on Friday morning that they had agreed at their Brussels summit to "devise measures to contain energy prices for households and companies".

He added, "Unity and solidarity prevail."

The EU now has "a very good timetable," said Commission President Ursula von der Leyen.

"We will implement a market correction mechanism to limit episodes of excessive gas prices," she added.

Your authority will work with the ministers of the EU countries on a legislative proposal.

The final declaration of the summit specifically mentions a "temporary dynamic price corridor" for trading in gas.

However, this should not jeopardize the security of supply.

In addition, a cost-benefit analysis is to be carried out for a price cap for gas used to generate electricity.

The maximum price should not lead to an increase in gas consumption. 

Scholz: "Good progress"

According to Chancellor Olaf Scholz (SPD), the federal states have also agreed on joint gas purchases, which the EU Commission proposes to make partly mandatory.

"I think that's good progress," said Scholz in Brussels.

In addition, the EU energy ministers are to examine in detail next Tuesday how price fluctuations through speculation on the gas market can be prevented.

The aim is "that it is not impossible to get gas through arbitrarily set prices," the Chancellor continued.

On the other hand, there are "still many doubts" about the question of whether a European upper limit for gas prices is possible, such as in Spain and Portugal.

Countries like Germany and Denmark spoke out against it.

The Chancellor therefore did not rule out another EU summit.

French President Emmanuel Macron also expressed his satisfaction with the agreement: "In my opinion, the goals of this summit have been achieved," he said after more than eleven hours of deliberations, which diplomats had described as tough.

France, together with the majority of countries, had campaigned for a European gas price cap and called on Scholz to give in.

According to Macron, the EU could already have "mechanisms that can be implemented by the end of October or beginning of November".

The EU Commission is now to present concrete legislative proposals for this.

Scholz firmly rejected Macron's assessment that he was isolated as Germany's representative in the EU.

This is "in no way" the case, emphasized the Chancellor.

The cooperation between him and the French President is as intensive as it is successful.

Macron said he mediated at the summit together with Council President Michel and "established unity between positions".

He will receive Scholz in Paris next Wednesday "so that we can move forward". 

The governments in Berlin and Paris had previously canceled a joint ministerial meeting, citing a lack of agreement on central points.

There are points of contention in energy and armaments policy.

The EU summit was also about further support for Ukraine.

Ukrainian President Volodymyr Zelenskyy warned in a video link with EU leaders that even more people could flee his country to the west because Russia was turning Ukraine "into a battlefield" with attacks on the energy system.

The heads of state and government will continue their deliberations on Friday morning.

The focus is on the EU's relations with Asia and preparations for the world climate summit in Egypt in November.