The president has spent much of the year playing down the threat of a virus that has killed more than 205,000 Americans.
Although the White House’s physician has said Mr Trump is expected to continue carrying out his duties “without disruption” while he recovers, the diagnosis is sure to have a destabilising effect in Washington.
While there is currently no evidence that Mr Trump is seriously ill, the positive Covid-19 test raises questions about what would happen if he were to become incapacitated.
The US constitution’s 25th amendment spells out the procedures under which the president can declare himself “unable to discharge the powers and duties” of office.
If he were to make that call, Mr Trump would transmit a written note to the Senate president pro tempore – Republican senator Chuck Grassley – and US House Speaker Nancy Pelosi.
US Vice President Mike Pence would serve as acting president until Mr Trump transmitted “a written declaration to the contrary”.
The vice president and a majority of either the cabinet or another body established by law can also declare the president unable to discharge the powers and duties of his office, in which case Mr Pence would “immediately assume the powers and duties of the office as acting president” until Mr Trump could provide a written declaration to the contrary.
Mr Pence tested negative for the virus on Friday morning and “remains in good health”, his spokesman said.
In the best of cases, if Mr Trump develops no symptoms – which can include fever, a cough and breathing problems – it will force him off the campaign trail just weeks before the election.
Mr Trump was last seen by reporters returning to the White House on Thursday evening and did not appear visibly ill.
The president is 74 years old, putting him at higher risk of serious complications from a virus that has infected more than seven million people nationwide.
Mr Trump’s Democratic challenger, Joe Biden, has been tested for coronavirus and is awaiting results, according to a source.
Jill and I send our thoughts to President Trump and First Lady Melania Trump for a swift recovery. We will continue to pray for the health and safety of the president and his family.
— Joe Biden (@JoeBiden) October 2, 2020
Mr Biden has spent much of the summer off the campaign trail and at his home in Delaware because of the virus.
The Democrat has since resumed a more active campaign schedule, but with small, socially distanced crowds. He also regularly wears a mask in public – something Mr Trump mocked him for at Tuesday night’s debate.
Mr Biden did not wear a mask during the televised debate.
The president’s announcement came hours after he confirmed that Hope Hicks, one of his most trusted and longest-serving aides, had been diagnosed with the virus on Thursday.
Ms Hicks began feeling mild symptoms during the plane journey home from a rally in Minnesota on Wednesday evening, and was isolated from other passengers on the flight, according to a source.
She had been with Mr Trump and other senior staff on board Marine One and Air Force One as it travelled to that rally and had accompanied the president to Tuesday’s presidential debate in Cleveland, along with members of the Trump family.
They did not wear masks during the debate, in violation of the venue rules.
It is unclear where the Trumps and Ms Hicks may have caught the virus, but, in a Fox interview, Mr Trump seemed to suggest it may have been spread by someone in the military or law enforcement.
“It’s very, very hard when you are with people from the military or from law enforcement, and they come over to you, and they want to hug you, and they want to kiss you,” he said, “because we really have done a good job for them. And you get close. And things happen.”
Multiple White House employees have previously tested positive for the virus, including Mr Pence’s press secretary, Katie Miller, national security adviser Robert O’Brien and one of the president’s personal valets.
However, Mr Trump has consistently played down concerns about being personally vulnerable, even after White House staff and allies were exposed and became ill.
He refused to abide by basic public health guidelines – including those issued by his own administration – such as wearing masks in public and practising social distancing.
Instead, he has continued to hold campaign rallies that draw thousands of supporters.
The news is sure to rattle an already shaken nation still grappling with how to safely reopen the economy without driving virus transmission.
The White House has access to near-unlimited resources, including a constant supply of rapid result tests, but still failed to keep the president safe, raising questions about how the rest of the country will be able to protect its workers, students and the public as businesses and schools reopen.
Questions remain about why it took so long for Mr Trump to be tested and why he and his aides continued to go to work and travel after Ms Hicks fell ill.
Mr Trump travelled to New Jersey on Thursday for a fundraiser, exposing attendees to the virus.
The White House began instituting a daily testing regimen for Mr Trump’s senior aides after earlier positive cases close to the president.
Anyone in close proximity to the president or vice president is also tested every day, including reporters.
However, since the early days of the pandemic, experts have questioned the health and safety protocols at the White House and asked why more was not being done to protect the US commander-in-chief.
Mr Trump continued to shake hands with visitors long after public health officials were warning against it, and he initially resisted being tested.