Prime Minister Boris Johnson imposed a strict new national lockdown on Monday as Britain’s desperate race to vaccinate its population risked being overtaken by a fast-spreading variant of the coronavirus that was on track to overwhelm the nation’s beleaguered hospitals.

After several days of frighteningly high and escalating case numbers, Mr. Johnson ordered schools and colleges in England to close their doors and shift to remote learning. He appealed to Britons to stay at home for all but a few necessary purposes, including essential work and buying food and medicine.

The decision was a fresh setback for Mr. Johnson, coming at a time when the arrival of two vaccines appeared to provide a route out of the crisis after nine fraught months and fierce criticism of his handling of the pandemic.