European Union leaders have agreed an embargo on Russian crude oil imports that will take full effect by the end of the year, but Hungary and two other landlocked Central European states secured exemptions for the pipeline imports they rely on.

The ban, agreed overnight after weeks of wrangling, aims to halt 90% of Russia's crude imports into the 27-nation bloc by year-end, officials said.

It is the toughest sanction yet on Russia for its invasion of Ukraine, and one that will itself affect the EU, where energy prices have spiked and inflation is running at close to a double-digit clip.

Russia accounted for just over a quarter of EU oil imports in 2020, while Europe is the destination for nearly half of Russia's crude and petroleum product exports.

"The sanctions have one clear goal: To prompt Russia to end this war, to withdraw its troops, and to agree a sensible and fair peace with Ukraine," German Chancellor Olaf Scholz said.

Ukraine said they would deprive the "Russian military machine" of tens of billions of dollars.

French President Emmanuel Macron said nothing could be ruled out regarding further sanctions, although other leaders poured cold water on the idea of banning purchases of Russian gas, on which Europe heavily depends.

EU countries will have six months to stop imports of seaborne Russian crude and eight months for refined products, the European Commission said.

That timeline will start once the sanctions are formally adopted, which EU states aim to do this week.

HUNGARY EXEMPT

The deal was reached only after the EU's other leaders agreed to give Hungary a free pass, having failed to win Prime Minister Victor Orban over in weeks of talks.

Two-thirds of the Russian oil imported by the EU comes by tanker and the rest through the Druzhba pipeline.

Poland and Germany are among the pipeline importers, but have pledged to stop buying Russian oil by the end of the year.

Landlocked Hungary, Slovakia and the Czech Republic all get their Russian oil from Druzhba and account for the 10% of imports temporarily exempted from the embargo.

Bulgarian Prime Minister Kiril Petkov said his country had also secured an exemption until the end of 2024, since its refinery is designed to receive only Russian crude.

Oil prices rose after the EU's agreement, adding fuel to inflation, which already hit a record 8.1% year-on-year in euro zone countries this month.

GAS NEXT?

The oil embargo follows an earlier ban on Russian coal and allows the bloc to impose a sixth round of sanctions that includes cutting Russia's biggest bank, Sberbank, off from the SWIFT international transaction system.

Commission chief Ursula von der Leyen said the package would also ban EU firms from insuring or reinsuring ships carrying Russian oil.

Ukrainian President Volodymyr Zelenskiy welcomed the latest sanctions but criticised what he called an "unacceptable" delay of more than 50 days since the EU's previous package.

Several countries already want to start work on a seventh round, but Austrian Chancellor Karl Nehammer said it could not include Russian gas, which covers a third of EU needs.

"Russian oil is much easier to compensate for ... gas is completely different, which is why a gas embargo will not be an issue in the next sanctions package," Nehammer said.

Russian analysts and traders said the phasing-in of the embargo gave Moscow time to find new customers in Asia.

"Although the measures announced by the European Union look threatening, we don't see a crippling impact on the Russian oil sector - neither imminent, nor in six months," analysts at Sinara Investment Bank said.

Beyond the sanctions, EU leaders asked the bloc's executive to explore options to tackle soaring energy prices. These include "temporary import price caps", which should be explored with international partners, their conclusions said.

They also endorsed a Commission plan to wean the EU off all Russian fossil fuels within years through a faster rollout of renewable energy, improvements in saving energy, and more investments in energy infrastructure.

And they called for better EU-wide contingency planning in case of further gas supply shocks. Moscow on Tuesday cut gas supplies to the Netherlands for rejecting its gas-for-roubles scheme, having already cut off Poland, Bulgaria and Finland.