Boris Johnson and the health secretary, Matt Hancock, have tested positive for coronavirus, they revealed on Friday, leaving them each to work in isolation on leading the government’s efforts to tackle the pandemic.

Later on Friday England’s chief medical officer, Prof Chris Whitty, said he was self-isolating at home after experiencing symptoms compatible with Covid-19.

The prime minister, who is 55, will self-isolate for seven days in his flat above No 11 Downing Street after announcing that he had mild symptoms of a cough and temperature.

Johnson received the result at midnight, just hours after he was seen outside the door of No 10 clapping in support of NHS workers, alongside the chancellor, Rishi Sunak.

Facebook Twitter Pinterest Boris Johnson (right) and Rishi Sunak clap in appreciation of NHS workers. Photograph: Andrew Parsons/10 Downing Street/AFP via Getty Images

Hancock, who has responsibility for the NHS, said he would self-isolate until next Thursday. Whitty, who has not taken a test, said he would “be continuing to advise the Government on the medical response to Coronavirus, supported by my deputies.”

Johnson and Hancock have been in repeated contact with senior political figures, including cabinet members, and advisers in the last few days. But despite the two men testing positive, no other ministers or advisers would be tested for the virus unless they showed symptoms, Downing Street said.

Asked whether Johnson and Hancock had been taking the same precautions they imposed on the rest of the country at the daily press briefing, Michael Gove said: “The fact that the virus is no respecter of individuals, whoever they are, is one of the reasons why we do need to have strict social distancing measures so that we can reduce the rate of infection and reduce the pressure on the NHS.”

And he told reporters: “People are tested if they are symptomatic and those members of the sort of central effort in helping to defeat the virus who do show symptoms are appropriately tested. I think you can tell from the fact that the three of us are here demonstrates that there are three of us who have not yet demonstrated any symptoms.”

It is unknown how Johnson contracted the illness but officials confirmed other people who worked in No 10 were self-isolating after having coronavirus symptoms.

Johnson posted a video on Friday morning on Twitter saying he had a temperature and a persistent cough. “I am working from home, I’m self-isolating, and that’s entirely the right thing to do,” he said.

In the video, which Johnson recorded himself on a mobile phone, he said: “Be in no doubt that I can continue thanks to the wizardry of modern technology to communicate with all my top team to lead the national fightback against coronavirus.”

Boris Johnson #StayHomeSaveLives (@BorisJohnson) 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.



Together we will beat this. #StayHomeSaveLives pic.twitter.com/9Te6aFP0Ri

The prime minister’s official spokesman said on Friday: “The prime minister’s symptoms are mild and he is continuing to do all of the same functions he was performing before. The only difference is now he will have to do that by teleconferencing.”

Johnson chaired Friday morning’s Covid-19 meeting of government ministers and health experts. His regular audience with the Queen has been conducted by phone for at least two weeks.

Although the foreign secretary is officially the person who steps in to cover the prime minister’s role if he is incapacitated, there are no plans for Dominic Raab to stand in for Johnson.

Johnson’s spokesman said: “From the moment he had symptoms he took steps to ensure that he wasn’t in close contact with anyone.

“He did really want to take part in clapping NHS staff. It’s something he felt was important, but in taking part in that national moment he ensured he didn’t come into close contact with anyone.

“He stood outside No 10 at a very significant distance from the chancellor.”

On testing people who have been close to Johnson in recent days, he said: “No 10 is considered a workplace. The advice to staff here and the prime minister’s colleagues is they don’t need to do anything in terms of self-isolation unless they start to suspect that they have symptoms, in which case they should follow the Public Health England advice.”

No 11 and the four-bedroom flat, which was previously occupied by the former prime ministers David Cameron and Tony Blair, have been sealed off from No 10 Downing Street and No 12 by shutting the doors that staff and government officials use to move between the buildings.

The prime minister will work from the office usually used by the chancellor, who has given it over to Johnson during his period of isolation. It has been kitted out with full videoconferencing equipment.

Sunak will continue to work from his office in the Treasury; it is not thought that his wife and young children are living at Downing Street. The last chancellor, Sajid Javid, lived in the smaller flat at No 10.

It is not known whether Sunak has been tested.

Quick guide What to do if you have coronavirus symptoms in the UK Show Hide Symptoms are defined by the NHS as either: a high temperature - you feel hot to touch on your chest or back

a new continuous cough - this means you've started coughing repeatedly NHS advice is that anyone with symptoms should stay at home for at least 7 days.

If you live with other people, they should stay at home for at least 14 days, to avoid spreading the infection outside the home. After 14 days, anyone you live with who does not have symptoms can return to their normal routine. But, if anyone in your home gets symptoms, they should stay at home for 7 days from the day their symptoms start. Even if it means they're at home for longer than 14 days. If you live with someone who is 70 or over, has a long-term condition, is pregnant or has a weakened immune system, try to find somewhere else for them to stay for 14 days. If you have to stay at home together, try to keep away from each other as much as possible. After 7 days, if you no longer have a high temperature you can return to your normal routine. If you still have a high temperature, stay at home until your temperature returns to normal. If you still have a cough after 7 days, but your temperature is normal, you do not need to continue staying at home. A cough can last for several weeks after the infection has gone.

Staying at home means you should: not go to work, school or public areas

not use public transport or taxis

not have visitors, such as friends and family, in your home

not go out to buy food or collect medicine – order them by phone or online, or ask someone else to drop them off at your home You can use your garden, if you have one. You can also leave the house to exercise – but stay at least 2 metres away from other people. If you have symptoms of coronavirus, use the NHS 111 coronavirus service to find out what to do. Source: NHS England on 23 March 2020

Johnson’s isolation will involve meals and work being delivered to him by staff, who will knock on the door and then give him time to collect it.

The prime minister’s spokesman would not comment on whether his partner, Carrie Symonds, who is pregnant, was in Downing Street or would be self-isolating. The recommendation for members of the household of someone who has the virus is to self-isolate for 14 days.

Play Video 1:28 Matt Hancock reveals he has coronavirus and is self-isolating – video

In a video message, Hancock said: “Fortunately for me the symptoms so far have been very mild so I’ve been able to carry on with the work driving forward the UK response.

“I’ll be continuing to do everything I can to get our carers the support that they need. And I’ll be doing that from here but with no less gusto.”