President Trump announced early on Oct. 2 that he and his wife, Melania, had tested positive for the novel coronavirus. (Video: The Washington Post, Photo: Amanda Voisard/The Washington Post)

President Trump and his wife, Melania, have contracted the coronavirus, he announced early Friday, after months in which he has often played down a pandemic that has killed more than 205,000 Americans and sickened millions more.

Trump, 74, was diagnosed hours after it became publicly known that Hope Hicks, a top Trump aide who traveled with him on Air Force One and Marine One this week, tested positive Thursday morning.

“Tonight, @FLOTUS and I tested positive for COVID-19,” the president tweeted just before 1 a.m. “We will begin our quarantine and recovery process immediately. We will get through this TOGETHER!”

The president’s physician, Sean P. Conley, wrote minutes later that Trump and his wife “are both well at this time, and they plan to remain at home within the White House during their convalescence.”

Hope Hicks and Stephen Miller are just two of the White House officials who have tested positive for the coronavirus. (Video: The Washington Post, Photo: Jabin Botsford/The Washington Post)

White House chief of staff Mark Meadows told reporters that the president was experiencing “mild symptoms,” but remained in “good spirits and very energetic.”

The president is expected to conduct official and political events from the residence — including a call Friday with senior citizens about the coronavirus.

The diagnosis is a jolt for the country’s leadership and had some advisers early Friday discussing the continuity of government should the president’s condition grow worse. Vice President Pence tested negative for the virus Friday morning, a spokesman said.

Republican National Committee Chairwoman Ronna McDaniel tested positive for the virus Wednesday but didn’t reveal her diagnosis until after Trump announced he had the virus. McDaniel was last with Trump a week ago at a Sept. 25 fundraiser.

Others in Trump’s immediate orbit who have tested negative so far include daughter Ivanka Trump, son-in-law Jared Kushner, teenage son Barron Trump, Treasury Secretary Steven Mnuchin and Secretary of State Mike Pompeo.

A maskless Meadows told reporters outside the White House that he and White House deputy chief of staff Dan Scavino also tested negative.

Meadows said he expected Trump to recover quickly, but would not comment on what treatment the president is receiving.

Trump’s early-morning announcement marked an extraordinary turn for the first family, coming little more than a month before Election Day and as Trump has escalated his campaign pace in an effort to catch Democratic nominee Joe Biden, who leads in national and key state polls. Trump, aides and voters say, trails largely because of his handling of the virus, which has dominated voters’ attention along with the economic collapse caused by pandemic shutdowns.

The virus could further challenge Trump’s reelection bid, because advisers were hoping to close the gap in upcoming weeks with an aggressive travel schedule and a message that the coronavirus had largely passed.

Since late Tuesday, Trump has appeared with thousands at a rally in Minnesota, debated Biden onstage and has interacted with a coterie of aides and political advisers at the White House. There was no immediate answer from Biden’s camp as to whether he had been tested.

After White House officials learned of Hicks’s symptoms, Trump and his entourage flew Thursday to New Jersey, where he attended a fundraiser at his golf club in Bedminster and delivered a speech. Trump was in close contact with dozens of other people, including campaign supporters, at a roundtable event.

The president did not wear a mask Thursday, including at the events at his golf course and on the plane, officials said. He was tested after he returned to the White House, but he also appeared on Sean Hannity’s TV show from the residence by telephone.

Two people who spent time with him said he did not show noticeable symptoms although he seemed tired and acknowledged to other aides later Thursday that Hicks was ill. During his fundraiser in New Jersey, “he said the things he usually says on TV,” said an attendee.

A senior administration official said the White House was not aware of any additional positive cases late Thursday, although aides are being tested and contacts traced. Some aides are expected to stay at home for the foreseeable future, and presidential and political travel will be canceled, officials said.

The president has pushed publicly for the country to reopen fully despite stubbornly high levels of cases, hoping that the resulting economic benefit and potential for nationwide optimism would spur his electoral chances. An infected president could raise concerns nationally about reopening businesses and schools — both key pushes from the president as the disease has spread.

Even as the virus exploded across the nation, Trump has continued to hold large events indoors and outdoors featuring mostly maskless crowds of people who squeezed together to greet the president. Some members of the Secret Service have also contracted the virus while preparing for presidential events, The Washington Post has reported.

Trump has regularly appeared in public and in private without a mask — and has mocked Biden for wearing one and for curbing his campaign events for safety’s sake. The president has insisted that the virus is mostly dangerous to older people — a group to which he belongs — or those with health complications, although medical experts say the virus can strike anyone. Trump has publicly and privately squabbled with a number of the medical experts in his administration over how seriously the White House should take the virus.

During a prerecorded speech to a Catholic charity dinner in New York on Thursday night, Trump took his usual optimistic tone about the virus. “And I just want to say that the end of the pandemic is in sight, and next year will be one of the greatest years in the history of our country,” he said.

In recent months, Trump has told others he was not particularly concerned about the virus, officials said, after initially showing some fear. Many of Trump’s aides also have eschewed masks, both in the West Wing presidential offices and on trips.

For some months, aides had vowed to be more careful around Trump, taking the temperature of visitors entering the White House complex, limiting access to the Oval Office, requiring daily testing of people close to him and urging mask usage in the West Wing. But mask usage has slipped in recent months, officials say, and temperatures have no longer been checked, although people around the president are still tested. The diagnosis is likely to raise additional concerns about the rapid testing system at the White House, which is known to have a lower accuracy rate than more intrusive tests.

Attendees at events with the vice president and the president have not been tested for the virus or required to have their temperatures taken. Early Friday, Pence expressed his sympathy to Trump.

“Karen and I send our love and prayers to our dear friends President @realDonaldTrump and @FLOTUS Melania Trump,” he tweeted. “We join millions across America praying for their full and swift recovery. God bless you President Trump & our wonderful first lady Melania.”

Later, Pence spokesman Devin O’Malley said the vice president had tested negative.

“As has been routine for months, Vice President Pence is tested for COVID-19 every day,” O’Malley said in a tweet. “This morning, Vice President Pence and the Second Lady tested negative for COVID-19. Vice President Pence remains in good health and wishes the Trumps well in their recovery.”

Hicks is among Trump’s closest staffers and regularly enters the Oval Office multiple times a day, meeting with White House and campaign aides.

She has been spotted on multiple occasions without a mask, along with other top aides.

Hicks traveled with the president to Pennsylvania for a rally Saturday, to Cleveland for the first presidential debate Tuesday and to Minnesota for another campaign rally Wednesday. Hicks was around the president and top political advisers extensively in recent days preparing for the debate, an official said early Friday.

She was photographed without a mask at the Pennsylvania rally clapping to the Village People’s “YMCA” with other Trump aides and in Cleveland on the tarmac deplaning Air Force One.

Her positive test came after she began showing symptoms at the Wednesday rally. A person familiar with the situation said Hicks was quarantined on the plane trip back from Minnesota.

Hicks, 31, served as Trump’s 2016 campaign spokeswoman from the beginning of his candidacy and then as White House communications director before leaving in March 2018 for a job at Fox News. She returned to the White House in February in the role of counselor to the president.

Trump told Fox News’s Sean Hannity during a live interview Thursday night that he and the first lady were tested after they learned about Hicks and were awaiting the results.

“She tested positive and I just went out with a test . . . so whether we quarantine or whether we have it, I don’t know,” Trump said. “So I just went for a test and we’ll see what happens. Who knows? . . . We spend a lot of time with Hope, so we’ll see what happens.”

Trump later tweeted that he and the first lady were awaiting test results. “In the meantime, we will begin our quarantine process.”

Trump also suggested Hicks could have contracted it from members of the military or law enforcement.

“It is 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 because we really have done a good job for them,” the president said. “You get close, and things happen. I was surprised to hear with Hope, but she is a very warm person with them. She knows there’s a risk, but she is young.”

After Hicks’s diagnosis, White House spokesman Judd Deere said the president was taking the matter “seriously.”

“The President takes the health and safety of himself and everyone who works in support of him and the American people very seriously,” Deere said. “White House Operations collaborates with the Physician to the President and the White House Military Office to ensure all plans and procedures incorporate current CDC guidance and best practices for limiting COVID-19 exposure to the greatest extent possible both on complex and when the President is traveling.”

Hicks is the most senior White House aide known to have tested positive for the virus. Pence’s spokeswoman, Katie Miller, caught the virus in May and Kimberly Guilfoyle, a top Trump fundraiser and girlfriend of the president’s son Donald Trump Jr., contracted the virus in July. Before Hicks, the most senior White House official to test positive was national security adviser Robert O’Brien in late July.

The White House administers daily coronavirus tests to aides, reporters and others who come into contact with the president. But public health experts warn they are not foolproof and that masks and social distancing are still the best protection against the virus.

At Tuesday’s debate, Trump was pressed on his insistence on having huge campaign rallies where no one is required to wear facial coverings or to socially distance.

“We’ve had no negative effect, and we’ve had 35 to 40,000 people at some of these rallies,” Trump said.

Biden shot back: “He’s been totally irresponsible the way in which he has handled the social distancing and people wearing masks, basically encouraged them not to. He’s a fool on this.”

Trump replied: “If you could get the crowds, you would have done the same thing. But you can’t. Nobody cares.”

Coronavirus: What you need to know

Covid isolation guidelines: Americans who test positive for the coronavirus no longer need to routinely stay home from work and school for five days under new guidance planned by the Centers for Disease Control and Prevention. The change has raised concerns among medically vulnerable people.

New coronavirus variant: The United States is in the throes of another covid-19 uptick and coronavirus samples detected in wastewater suggests infections could be as rampant as they were last winter. JN.1, the new dominant variant, appears to be especially adept at infecting those who have been vaccinated or previously infected. Here’s how this covid surge compares with earlier spikes.

Latest coronavirus booster: The CDC recommends that anyone 6 months or older gets an updated coronavirus shot, but the vaccine rollout has seen some hiccups, especially for children. Here’s what you need to know about the latest coronavirus vaccines, including when you should get it.