The US president is 74, putting him at higher risk of serious complications.
Here is a look at other leaders who have had the virus.
The UK Prime Minister was the first major world leader confirmed to have Covid-19. He was moved to intensive care in April when his symptoms dramatically worsened a day after he was admitted to hospital for what were called routine tests. He was given oxygen but did not need a ventilator, officials said. He later expressed his gratitude to NHS staff for saving his life when his treatment could have “gone either way”.
The Prince of Wales also tested positive in March and showed mild symptoms.
The Brazilian president announced his illness in July and used it to publicly extol hydroxychloroquine, the unproven malaria drug he had been promoting as a treatment for Covid-19 and was taking himself. For months he had flirted with the virus as he flouted social distancing at lively demonstrations and encouraged crowds during outings from the presidential residence, often without a mask.
The Honduras president announced in June that he had tested positive, along with two other people who worked closely with him. Mr Hernandez said he had started what he called the “MAIZ treatment”, an experimental and unproven combination of microdacyn, azithromycin, ivermectin and zinc. He was briefly treated in hospital and then released. He has added his voice to growing pleas for equitable access to any Covid-19 vaccine, asking the recent UN gathering of world leaders: “Are people to be left to die?”
The president of Belarus, who dismissed concerns about the virus as “psychosis” and recommended drinking vodka to stay healthy, said in July he had contracted it himself but was asymptomatic. Belarus is one of the few countries that took no comprehensive measures against the virus. Other senior officials in former Soviet states who were infected include Armenian prime minister Nikol Pashinyan and Russian prime minister Mikhail Mishustin.
The palace of Monaco in March said the ruler of the tiny Mediterranean principality had tested positive but his health was not a concern. He was the first head of state to publicly say he had been infected.
The Guatemalan president said he tested positive for the virus in September. “My symptoms are very mild. Up to now, I have body aches, it hurt more yesterday than today, like a bad cold,” he said during a televised address. “I don’t have a fever, I have a bit of a cough.”
The virus drove the Bolivian interim president into isolation in July, but she said she was feeling well.
The newly elected president of the Dominican Republic contracted and recovered from Covid-19 during his campaign. He spent weeks in isolation before the country’s July election.
Iran, the epicentre of the Middle East’s initial outbreak, has seen several senior officials test positive. Among them were senior vice president Eshaq Jahangiri and vice president Massoumeh Ebtekar.
Vice president M Venkaiah Naidu, 71, recently tested positive but his office said he had no symptoms and was quarantined at home. Home minister Amit Shah, the number two man in prime minister Narendra Modi’s government, was admitted to hospital last month and has recovered. Junior railways minister Suresh Angadi last week was the first federal minister to die from Covid-19.
Israel’s then-health minister Yaakov Litzman tested positive in April and recovered. He is a leader in Israel’s ultra-Orthodox community, which has seen a high rate of infection as many have defied restrictions on religious gatherings. The minister for Jerusalem affairs, Rafi Peretz, tested positive over the summer as cases surged nationwide, and also recovered.
The country’s mineral resources and energy minister Gwede Mantashe and labour minister Thulas Nxesi were infected as cases surged in June and July.
Vice president Riek Machar was among several cabinet ministers to be infected.
Vice president Isatou Touray tested positive in July along with the ministers of finance, energy and agriculture.
Prime minister Nuno Gomes Nabiam in April said he had tested positive.