Shell Plc and BP Plc said they won't make any new purchases of Russian oil and gas, but won't be able to immediately to disentangle themselves from the country due to long-term contracts and the likely difficulty of finding alternative supplies.

The announcements, which for Shell mark a dramatic U-turn in response to international opprobrium for its purchase of Russian crude last week, accelerates energy companies' rejection of Russia over its invasion of Ukraine.

Yet it also highlights the risks of the move, with Shell warning that its refineries might end up producing less fuel. BP warned that it could have to backtrack on its pledge if security of energy supply was threatened.

"There is no easy fix to replace these Russian barrels,"said Keshav Lohiya, founder of consultant Oilytics Ltd. "With crude inventories already running low, reduced refinery runs might be the only solution."

Last week, Shell drew heavy criticism for buying a cargo of Russian crude. Ukraine's Minister for Foreign Affairs Dmytro Kuleba took to Twitter to ask the company whether the oil smelled like "Ukrainian blood for you?"

"We are acutely aware that our decision last week to purchase a cargo of Russian crude oil" was wrong, the company said in a statement on Tuesday. "Our actions to date have been guided by continuous discussions with governments about the need to disentangle society from Russian energy flows."

Shell said it could take weeks to remove Russian crude oil from its expansive network and will result in lower output of fuels at some of its refineries where alternatives are not so readily available. That comes as diesel markets are already in crisis mode as traders tried to make sense of the magnitude of supply shortfalls due to the Russia crisis.

Ending the company's use of refined oil and natural gas supplies from the country "will take much longer" because it represents such a "complex challenge," according to the statement.

The invasion of Ukraine prompted a huge range of companies to withdraw from their operations in Russia, including energy giants BP Plc and Exxon Mobil Corp. Attention has now shifted to the country's energy exports, a crucial source of revenue for President Vladimir Putin's government.

In the U.S., key lawmakers announced the outline of bipartisan legislation to bar imports of Russian oil into the U.S. Europe, which is more dependent on the country's crude, have so far shied away from a ban, but pressure is growing on companies that continue to receive the country's energy exports.

BP was less emphatic than Shell in its intention to phase out Russian energy supplies. A spokesman said the company "will continue to meet existing contractual obligations subject to meeting sanctions, security, and shipping requirements and where it is safe to do so."

It also said that it would not charter Russian-owned, operated or flagged vessels "where possible." BP could, however, enter into new business with Russia if it was "essential for ensuring security of supply."

Shell will also shut its service stations, aviation fuels and lubricants operations in Russia.

TotalEnergies SE Chief Executive Officer Patrick Pouyanne said on Monday that his company's trading arm had already stopped buying Russian oil, but one its refineries in Germany would continue to receive crude from the country because there was no alternative supply. The company is the only western oil major to not pull its investments from Russia, opting instead to pause capital spending on new projects there.

Engie SA CEO Catherine MacGregor said in a Bloomberg TV interview on Tuesday her company continues to buy Russian gas because its customers depend on those supplies.

Even without direct Western sanctions on Russian energy exports, the risk that buyers will voluntarily shun the country's supplies have triggered unprecedented surges in crude and natural gas prices. The International Energy Agency, which already announced the release of 60 million barrels of oil from emergency stockpiles, is prepared to recommend that its members release more if necessary, Executive Director Fatih Birol said in an interview on Bloomberg.

James Herron and Laura Hurst report for Bloomberg News.

Copyright 2022 Bloomberg. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.