Boris Johnson is self-isolating after meeting an MP who later tested positive for Covid-19.
The PM was contacted by NHS Test and Trace on Sunday but is not showing symptoms, Downing Street said.
Mr Johnson spent about 35 minutes with Ashfield MP Lee Anderson who has since tested positive, BBC political correspondent Nick Eardley said.
In April, Mr Johnson spent three nights in intensive care after falling ill with the virus.
He later said it “could have gone either way” and thanked healthcare workers for saving his life.
In a statement, a No 10 spokesman said: “The prime minister has today been notified by NHS Test and Trace that he is required to self-isolate as a contact of someone who has tested positive for Covid-19.
“The prime minister will follow the rules and is self-isolating.
“He will carry on working from Downing Street, including on leading the government’s response to the coronavirus pandemic.
“The PM is well and does not have any symptoms of Covid-19.”
Conservative MP Mr Anderson posted on his Facebook page to say he was self-isolating.
“On Friday I lost my sense of taste at the same time my wife had a bad headache,” he said. “I had no cough, no fever and felt well. We both had a test on Saturday and the result came in Sunday morning.
“My wife and I both tested positive. I feel absolutely fine and my biggest concern is my wife who is in the shielded group.
“But we are both feeling good.”
On Thursday, Mr Anderson posted a photo of himself with Mr Johnson at No 10 alongside the words: “Breakfast with the PM.”
BBC political editor Laura Kuenssberg tweeted the news had come the night before what was meant to be a “big relaunch week”, following the row last week involving the PM’s chief adviser Dominic Cummings.
Mr Cummings left Downing Street for the last time on Friday following internal battles about his role.
Earlier this weekend, a senior Tory MP said Mr Cummings’ departure was a chance to “reset government”.