Biden bans U.S. imports of Russian oil and natural gas, and Britain vows to phase Russian oil out.

WASHINGTON — President Biden said Tuesday that the United States was punishing Russia for a “vicious war of choice” in Ukraine by banning importation of the country’s oil, gas and coal, but warned Americans that the decision would inevitably mean painful, higher prices for energy and at the gas pump.

“I said I would level with the American people from the beginning,” Mr. Biden said. “And when I first spoke to this, I said defending freedom is going to cost. It’s going to cost us as well, in the United States.”

White House officials said the president signed an executive order on Tuesday that prohibits anyone in the United States from importing “Russian crude oil and certain petroleum products, liquefied natural gas and coal.” It also bans new U.S. investment directly in Russia’s energy sector or in foreign companies that are investing in energy production in Russia, officials said.

Mr. Biden’s decision effectively shuts off the relatively small flow of oil into the United States, which receives less than 10 percent of its energy resources from Russia. Republicans and Democrats in Congress had been urging the president to take the step to ensure that Mr. Putin was not profiting from American purchases of oil.

Britain on Tuesday joined the United States in taking action. In an announcement at about the same time as Mr. Biden was speaking, Britain said it would phase out imports of Russian oil by the end of the year to increase the economic isolation of Russia’s president, Vladimir. V. Putin.

The British decision does not affect Russian gas supplies and would give oil importers several months to make alternative plans to try to avoid any disruption.

Unlike several other western European nations, Britain is not a big importer of Russian energy. Still, Russia accounted for 8.3 percent of Britain’s crude oil imports in 2020, according to government statistics, and prices have already been rising at gas stations while other energy costs, for industry and domestic heating, have spiked there.

In brief remarks before heading to Texas for an event about veterans, Mr. Biden vowed to do what he could to minimize the impact of the decision on gas prices, but he did not specify whether the United States would seek to import oil from other countries already under sanctions, like Venezuela or Iran.

And he warned oil companies in the United States not to take advantage of the decision by arbitrarily raising prices.

“Russia’s aggression is costing us all,” he said. “And it’s no time for profiteering or price gouging.”

Officials said Mr. Biden had struggled for days about whether the take the step amid concerns about whether it would accelerate the already rapid rise in the price of gasoline — a potent political issue for Americans in a critical election year.

In announcing his decision, Mr. Biden acknowledged that some European countries, including Germany and France, would most likely not follow suit because they rely much more heavily on energy from Russia.

“A united response to Putin’s aggression has been my overriding focus to keep all of NATO and all of the E.U. and our allies totally united,” Mr. Biden said. “We’re moving forward with this ban understanding that many of our European allies and partners may not be in a position to join us.”

Already, concern about disruptions in the flow of oil around the world has pushed up the price of Brent crude, the global benchmark for oil. On Tuesday morning, Brent crude hit $130 a barrel. It has been as high as $139 a barrel, up 26 percent over the past week.

In his remarks, Mr. Biden sought to blunt the attacks from Republicans, who have already accused the administration of pursuing environmental policies — such as blocking drilling on some public lands — that have made the situation worse. Some Republicans have urged the president to allow more drilling as a way of replacing the oil that has been coming from Russia.

Mr. Biden said that oil companies in the United States already have permission to drill in areas that they have not yet tapped.

“They have 9,000 permits to drill now,” he said. “They could be drilling right now, yesterday, last week, last year. They have 9,000 to drill onshore that are already approved. So let me be clear — let me be clear. They are not using them for production now. That’s their decision. These are the facts.”

Many Republicans and Democrats in Congress have pushed for a ban on Russian energy. But the White House is bracing for criticism from Republicans as the price of gas and other energy rises over the coming weeks.

“This crisis is a stark reminder: To protect our economy over the long term, we need to become energy independent,” he said, adding: “It should motivate us to accelerate the transition to clean energy.”