LONDON — The United Kingdom, hoping to ease a supply-chain crisis and forestall a Christmas logjam, will grant temporary visas to more than 10,000 foreigners to work as truck drivers and in the food industry.

The move is a departure for the government of Prime Minister Boris Johnson. After exiting the European Union in January 2020, Britain overhauled its immigration system to end what it called an overreliance on cheap, low-skilled foreign labor. Officials said they wanted to develop the domestic workforce, and employers needed to adjust and invest more in technology and automation.

But in a U-turn announced late Saturday, officials said they would allow 5,000 temporary visas for truck drivers and 5,500 for poultry workers through Christmas Eve. Britain is grappling with a string of shortages: Supermarkets are running out of goods, and restaurant chains such as McDonald’s and KFC are cutting items from their menus.

The truck driver shortage is particularly acute. Britain’s Road Haulage Association estimates the country needs about 100,000 drivers.

The crisis spread over the weekend to gas stations, resulting in long lines at the pump. BP said that about 30 percent of its 1,200 sites in Britain had run out of the two main grades of fuel on Sunday. Some stations said they were rationing fuel.

The gloom was lifted, at least momentarily when the BBC sent a reporter to a gas station to cover the crisis. His name? Phil McCann.

Business groups said the emergency visas were too little, too late. For months, businesses have warned of labor shortages across the economy and urged the government to relax its rules for some sectors to make it easier to recruit workers from the European Union.

But the government resisted the calls, saying an influx of cheaper foreign labor could reduce companies’ incentives to improve pay and working conditions for British workers.

Andrew Marr, a BBC presenter, asked Transport Secretary Grant Shapps about the government’s reversal on his Sunday morning show: “On Friday, you said you weren’t going to bring in foreign workers, and now you are.”

“I said we will do whatever we need to do to make sure that things flow in this country,” Shapps said in response. “But we don’t want to be relying on overseas labor in the longer run, which is why this is limited to Christmas.”

Officials will be keen to avoid scenes from 2000, when a fuel-
related crisis nearly brought the economy to gridlock. It was the only time during Tony Blair’s first term that his popularity ratings took a serious hit.

In addition to the new visas, the government is urging retired drivers to help ease the shortage and said the army will help with testing new drivers.

The British Chambers of Commerce likened the announcement to “throwing a thimble of water on a bonfire.” Roger Gale, a Conservative lawmaker, told Times Radio that the new visas were a good start, but not enough.

“This is not just about lorry drivers,” he said. “This is also about fruit pickers.” He said Thanet Earth, the country’s largest greenhouse complex, which based in his constituency, had to throw away 300,000 pounds’ worth, or about $410,000, of tomatoes because there was nobody to pick them.

“It’s all very well for the home secretary to say domestic labor should do the job, but domestic labor isn’t doing the job,” Gale said.

Some questioned whether foreign workers would go to Britain for just a few months only to be sent home before Christmas.

“There is a driver shortage across Europe,” Marco Digioia, head of the European Road Haulers Association, told Britain’s Observer newspaper. “I am not sure how many would want to go to the U.K.”

Industry groups in Britain say Brexit has exacerbated the driving shortage by making it harder to recruit from the E.U. The coronavirus pandemic has played a part, too, as some foreign workers have returned to their home countries. The pandemic also put on hold testing for recruits.

Shapps rejected the notion that Brexit had worsened the situation. “Brexit gives us the flexibility to set our own rules — in this case, produce visas because I don’t want to see these queues at all,” he told the BBC. He noted that leaving the E.U. has helped him expand the number of tests for drivers. “We’ve benefited from some of those extra freedoms.”

Others disagreed.

Global trade analyst David Henig said the situation was complex, but “clearly, Brexit is also the reason global strains, as there are, are exacerbated in the U.K.”

“The U.K. has made a big change to our trading relations, our people-movement relations, at exactly the point when there is a global strain on global supply chains,” he said. “You got to expect in that situation you will run into problems.”