LONDON — British Prime Minister Boris Johnson said Friday that he had tested positive for the coronavirus, making him one of the first world leaders to become a patient in the global pandemic.

Just a few hours later, British Health Secretary Matt Hancock alerted the public that he had also tested positive for the virus. Soon after, England’s chief medical officer, Chris Whitty, said he, too, was experiencing symptoms of a covid-19 infection. He did not say if he had been tested.

All three men said their symptoms were mild so far. They confirmed that they were self-
isolating and working from home. But the one-two-three punch came as a shock, even as Britain’s infections have been doubling every three to four days, with 14,543 confirmed cases and 759 deaths recorded as of Friday.

Scientists have warned that many more people will be stricken before the virus peaks, and public health officials are scrambling to erect temporary hospitals in convention centers in London, Birmingham and Manchester to handle the coming wave.

At an evening news conference on Friday — which none of the three sick leaders attended, though they had been fixtures at earlier briefings — government officials were asked if they were failing to take their own advice about social distancing, or had acted too slowly to protect themselves and the country.

Cabinet Office Minister Michael Gove dodged the query, saying the high-profile infections “were a reminder that the virus does not discriminate.”

Britain lagged behind other European countries in embracing strict measures to slow the spread of the virus.

On March 3, just a few days after a visit to Kettering General Hospital, Johnson told a news conference, “I was at a hospital the other night where there were a few coronavirus patients. I shook hands with everybody, you will be pleased to know, and I continue to shake hands.” His spokesman later clarified he shook hands with staff, not patients.

British officials voiced concern about “behavioral fatigue” — that if they told people to stay home too soon, people would tire of the situation and rebel.

But the prime minister changed course Monday to pursue what he has described as “drastic measures” to save lives and keep the National Health Service from being overwhelmed.

Britain is now on a kind of soft lockdown, with citizens urged to work from home, remain indoors and venture out only to buy food and medicine or exercise once a day. All pubs, restaurants and gyms and most shops have shuttered. Police are issuing warnings to those who disobey the measures by gathering in groups larger than family-size.

Hours after Prime Minister Boris Johnson said he’d tested positive for coronavirus on March 27, Health Secretary Matt Hancock said he, too, is infected. (@MattHancock via Twitter)

Johnson was last seen in public on Thursday evening in front of 10 Downing Street, where he joined a national round of applause for health-care workers.

The prime minister’s spokesman said Johnson suffered from a persistent cough and fever on Thursday morning, was tested in the afternoon and received the results before midnight.

Johnson revealed his infection in a tweet Friday morning: “Over the last 24 hours I have developed mild symptoms and tested positive for coronavirus. I am now self-isolating, but I will continue to lead the government’s response via video-conference as we fight this virus.”

He shared a video message in which he once again urged Britons to “stay at home” to stop the spread of the virus. He signed off, saying: “We are going to beat it, and we are going to beat it together.”

The 55-year-old Johnson, who enjoys bicycle rides and ambling jogs, as well as French wine and English sausage, does not suffer from any known underlying health conditions that would make him especially vulnerable to complications.

If he became too sick to work, however, Foreign Secretary Dominic Raab would take the reins. If Raab were infected, the leadership could pass to another minister further down the line.

Until this week, Johnson was attending royal functions, delivering speeches at the House of Commons and chairing cabinet meetings. The prominent British epidemiologist Neil Ferguson, of Imperial College, who also tested positive recently for coronavirus, pointed out that Westminister was likely a hotbed for germs.

The prime minister last appeared at the government’s daily news conference two days ago.

But Johnson this week finally began to hold his meetings via videoconference, perched at a nearly empty table and looking at a large screen filled with the talking heads of his ministers and scientific and medical advisers. He participated, as did other leaders, in a Group of 20 summit via video link.

Johnson is the first leader of the G-20 group of nations to test positive for the virus. Two others — German Chancellor Angela Merkel and Canadian Prime Minister Justin Trudeau — tested negative but entered self-quarantine over concerns they may have been exposed. Trudeau’s wife and the wife of Spanish Prime Minister Pedro Sánchez have coronavirus infections confirmed.

Johnson, on his doctor’s recommendation, has withdrawn into his chambers for seven days and will forgo all public appearances and in-person group meetings. He will have his food left at the door to his apartment, his aides said.

“He’s self-isolating in his flat,” said his official spokesman.

His fiancee, Carrie Symonds, 31, who is pregnant and due to deliver in early summer, lives with the prime minister at the official residence. But the Telegraph newspaper reported that she’s “now isolating alone away from No. 10 with the couple’s dog, Dilyn.”

Like the White House, Johnson’s home is also an office — and 10 and 11 Downing are usually busy hives, with ministers, aides, journalists and visitors coming and going, and squeezing past each other in the narrow hallways.

The prime minister and the queen typically meet face-to-face once a week. But Buckingham Palace said Queen Elizabeth II last saw the prime minister on March 11.

The 93-year-old queen has been staying at Windsor Castle, west of London, and “remains in good health,” according to palace officials. Her son and heir, Prince Charles, has tested positive for the virus and is in quarantine in Scotland.

Jennifer Hassan contributed to this report.