Prime Minister Boris Johnson of Britain on Wednesday announced major new restrictions to curb the fast-spreading Omicron variant, reversing course on a long-held policy at a moment of acute political peril for him, with his staff accused of flouting the rules by holding an office party during last year’s lockdown.

Mr. Johnson’s decision to adopt a contingency plan he had long resisted — even in the face of Britain’s already high daily rate of infections — underscored the threat posed by the new variant. But the timing raised questions about whether Mr. Johnson was motivated more by public health or politics.

Critics, including a lawmaker from his own Conservative Party, accused the prime minister of trying to deflect attention from an outcry over whether officials held a holiday gathering that flouted lockdown rules in December 2020, when Britain was caught in the grip of an earlier coronavirus variant.

Under the government’s new guidance, known as Plan B, people in England will be urged to work from home if possible, starting next week. They will also be required to wear face masks in cinemas, theaters and most other indoor places, and to show a pass proving their vaccinated status to be allowed into nightclubs and large venues, like sports stadiums. He also said that negative tests would be included on vaccine passes as an alternative to proof of vaccination.

“It’s become increasingly clear that Omicron is growing much faster than the previous Delta variant, and is spreading rapidly throughout the world,” the prime minister said. “We need to go further and faster still.”

Mr. Johnson delivered the news Wednesday evening in Downing Street’s briefing room, its wood-paneled walls and Union Jack flags lending gravity to his words. But the same room was featured in a less dignified video that surfaced on Tuesday evening in which Mr. Johnson’s former press secretary, Allegra Stratton, and other aides joked about whether an illicit party had been held in Downing Street during the lockdown.

That exchange, caught during the videotaping of a mock news conference last year, was deeply damaging to Mr. Johnson because it suggested that his aides ignored the very rules they were imposing on the public. They were mocking coronavirus rules at a moment when Britons had been ordered to cancel parties and family reunions, and when some were prevented from saying last farewells to dying relatives.

The smug tone of the mock news conference added to the outrage. At one point Ms. Stratton can be heard saying “Is cheese and wine all right?” and “This fictional party was a business meeting.” She then laughs and adds, “And it was not socially distanced.”