WASHINGTON — President Biden tested positive Thursday for the coronavirus, raising concerns about the 79-year-old president’s health and underscoring that the virus remains a persistent threat in a country trying to put the pandemic behind it. Karine Jean-Pierre, a White House press secretary, said in a statement that Mr. Biden was “fully vaccinated and twice boosted and had very mild symptoms.” Dr. Kevin O’Connor, the president’s physician, said in a letter released by the White House that Mr. Biden had been experiencing fatigue, a runny nose and an occasional dry cough. “I predict that he will respond favorably, as most patients do with maximum protection,” Dr. O’Connor wrote. The president is taking Paxlovid, an antiviral drug used to minimize the severity of Covid-19, Ms Jean-Pierre said. He will self-isolate at the White House but will “continue to fully perform all of his duties during this period,” he said. Mr Biden tweeted in the afternoon saying he was “doing great” and “busy!” In a short video posted on Twitter, Mr Biden thanked people for their concern and said he was “doing well, doing a lot of work”. In the video, Mr. Biden is seen standing near a balcony overlooking the South Lawn of the White House, dressed in a suit but without a tie. “Keep the faith,” Mr. Biden says in the video. “It will be OK”. He was scheduled to fly to Pennsylvania on Thursday for a speech on gun violence and then travel home to Wilmington, Del., for the weekend. White House officials said both trips were canceled. Dr. Ashish K. Jha, Mr. Biden’s coronavirus response coordinator, said at a White House briefing that he believes the president is not at serious risk of serious illness given that he is fully up-to-date on his vaccines and taking Paxlovid. “Because the president is fully vaccinated, doubly boosted, the risk of severe illness is dramatically lower,” Dr. Ja said, adding, “We expect he will have mild illness.” Mr. Biden will self-isolate for five days at the White House residence, Dr. Tza said, and will resume normal activities only when he tests negative. Vice President Kamala Harris, who was last with the president on Tuesday, tested negative, according to the White House. Jill Biden, the first lady, also tested negative Thursday morning, according to Michael La Rosa, her spokesman. Ms. Harris and Dr. Biden have also received two boosters. The president’s diagnosis was a moment his aides had spent years striving for. As a candidate in 2020, Mr. Biden took extraordinary measures to avoid getting sick, holding “drive-in rallies” and avoiding the in-person events that have characterized life on the campaign trail. As president, he remained severely isolated in the first months of his term as the virus grew. The number of staff members he interacted with was limited. Members of the media and others were regularly screened. Mr. Biden and his staff wore masks at all times. More recently, however, as the number of people vaccinated has risen and many Americans have shrugged off concerns about the pandemic, the president has largely resumed regular activity. Last week, he returned from Israel and Saudi Arabia, where he shook hands and hugged many world leaders. At home, Mr. Biden rarely wears a mask and has hosted crowded White House events, even as the nation grapples with a flurry of cases from new subvariants that are highly contagious and can more easily evade vaccine protection. His advisers say he has followed guidelines from the CDC and the District of Columbia. In her statement, Ms. Jean-Pierre said officials would notify any members of Congress, reporters or others believed to have had close contact with the president during a trip to Massachusetts on Wednesday. “In accordance with the White House’s protocol for Covid-positive cases, which exceeds CDC guidelines, he will continue to work in isolation until he tests negative,” the statement said. “Once he comes out negative, he will go back to his personal work.” Mr. Biden is regularly vetted. His last test was on Tuesday, when he tested negative, officials said Thursday. It was unclear exactly how he became infected, and White House officials declined to offer detailed information about who he had been in contact with in recent days. It is difficult to determine exactly how or when someone contracted the virus. Mr. Biden had a series of close conversations before he was infected. In March, he attended a celebratory event with Irish Prime Minister Micheal Martin, who left after testing positive. Mr. Biden also attended the White House Correspondents’ Association dinner in May, and several attendees tested positive afterward, including Secretary of State Antony J. Blinken. Mr. Biden and his top aides urged people to get vaccinated and get souvenirs. The vaccine is very effective at protecting people from becoming seriously ill or dying, even when new infections occur. The president and Democratic lawmakers have pleaded with Republicans in Congress to approve emergency coronavirus funding to ensure the United States can buy new vaccines and treatments. Mr. Biden is the second president to contract the coronavirus. In October 2020, President Donald J. Trump tested positive and was airlifted to Walter Reed National Military Medical Center, where he was given steroids and other treatments. Mr Trump and his aides played down his symptoms at the time, but later reports revealed he was very ill. Noah Weiland and Katie Rogers contributed reporting.