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 contracted the novel coronavirus after months in which he and people around him — his aides, his children, even his golf-club members — avoided taking basic steps to prevent the virus’s spread, like wearing masks and avoiding large indoor crowds.

Mask-wearing had become rare among Trump’s staff and the Secret Service agents and military service crew aboard Air Force One — even after national security adviser Robert C. O’Brien tested positive in July.

On the campaign trail, Trump’s sons Donald Jr. and Eric have spoken to packed audiences in indoor venues. And the Trump campaign violated state regulations limiting the size of gatherings in Nevada, earning a public rebuke from the governor after the president addressed thousands at an indoor event there last month.

They all took their cues from Trump himself, who has rarely worn masks, sometimes mocked those who did and disputed the advice from his own government’s experts.

Lawmakers and pundits reacted to President Trump and first lady Melania Trump’s positive coronavirus tests on Oct. 2 (Video: The Washington Post)

While the nation suffered through an unprecedented and fear-filled lockdown, there was a bubble at the top, where Trump’s actions seemed to flout the laws of disease, and to embolden — or coerce — those around him to try it, too.

Asked by The Washington Post’s Bob Woodward earlier this year if he was afraid of catching the virus, he said he wasn’t. “I don’t know why I’m not,” he said, according to a recording of the interview. “I’m not.”

On Friday, the bubble burst.

Live updates: Trump diagnosed with the coronavirus

After the news that the president and first lady Melania Trump had tested positive, there were more positive tests from Trump’s orbit — Republican National Committee Chairwoman Ronna McDaniel; and several people who attended Trump’s announcement of Judge Amy Coney Barrett’s nomination to the Supreme Court on Saturday at the White House, including former senior adviser Kellyanne Conway.

Trump and his family members canceled all of their planned in-person campaign events.

Now, dozens of people — donors, aides, Secret Service agents — who had been close to Trump before his diagnosis wondered if they, too, might be infected. A whole world, with Trump at its center, suddenly faced the threat that the president had encouraged them to deny or understate.

Secret Service agents expressed their anger and frustration to colleagues and friends Friday, saying that the president’s actions have repeatedly put them at risk. “He’s never cared about us,” one agent told a confidant, who spoke on the condition of anonymity to describe the internal reaction.

Former Secret Service agents said it was unheard of for agents to openly complain about their president but that some currently in the ranks had become convinced during the pandemic that Trump was willing to put his protectors in harm’s way.

Agents who work in field offices around the country complained that since late August, they are no longer being tested when they return home from working at a rally for the president.

“This administration doesn’t care about the Secret Service,” one current agent relayed in an internal discussion group. “It’s so obvious.”

Judd Deere, spokesman for the White House, said in a statement: “The President takes the health and safety of himself and everyone who works in support of him and the American people very seriously.” Various staffs work together, he said, to “ensure all plans and procedures incorporate current CDC guidance and best practices for limiting COVID-19 exposure.”

Trump aides note that every aide and visitor who sees the president is tested for the coronavirus with a rapid test, and top administration officials are tested every day.

But infectious-disease experts on Friday said Trump’s positive test did not shock them. Although the president and those around him were tested regularly, experts said that he still made himself vulnerable by not taking other precautions.

“It’s not surprising, based on his schedule and level of social interactions, that he and his wife tested positive,” said Amesh Adalja, an infectious-disease expert at the Johns Hopkins University Center for Health Security. “It shows that even where there were pretty extensive measures to minimize risks, there’s always going to be a nonzero risk.”

Trump has sought from the start to downplay the dangers of the disease and he has repeatedly promised a victory — only to see his promises fall short.

In January and February, the president promised the virus might soon disappear as the weather turned warmer. That didn’t happen. Instead, the virus spread — triggering lockdowns nationwide.

But Trump soon began to push for rapid reopenings, echoing conservative attacks on governors in Democratic-led states. The president sought to hold events indoors — including fundraisers with wealthy, unmasked donors. In June, seeking to show that the country was returning to normal, Trump held an indoor rally in Tulsa.

That, also, did not go as he planned. Only about 6,000 supporters showed up, the city fire marshal said, leaving the 20,000-seat arena largely empty. The president was resistant to outdoor venues and smaller ones. Businessman Herman Cain, who attended the rally and was photographed without a mask, died of complications of the virus in July, though it is unclear where or when he contracted the disease.

“It’s not just Trump. It’s the entire senior team around the White House participating in this fiction that, ‘We can ignore it,’ ” said Simon Rosenberg, founder of the liberal think tank NDN. “They’re not in a bubble if they’re around other people and not wearing masks. The whole reliance [just] on testing was insane.”

With cases spiking in the summer — as the virus spread to states that had been relatively spared in the early months — White House and Trump campaign aides grew alarmed. The president’s public approval ratings had fallen and he was trailing Democratic presidential nominee Joe Biden in election polling. On July 11, Trump donned a mask for the first time in public during a visit to meet with injured U.S. service members at Walter Reed National Military Medical Center.

But since then, Trump has only worn the mask a few times in public, and he quickly resumed rally-style events, held mostly at airport hangars that are at least partially outdoors. Thousands of supporters, most of them barefaced and crammed shoulder-to-shoulder, cheered for the president and his surrogates at events that routinely lasted well over an hour.

In late August, Trump packed the South Lawn with thousands of supporters — most of whom were not tested ahead of time and did not wear masks — for his acceptance speech at the Republican National Convention.

“We will have a safe and effective vaccine this year, and together we will crush the virus,” Trump declared.

Inside the White House, many aides seemed to share his confidence.

“The White House was a petri dish,” said Olivia Troye, a former staffer to Vice President Pence, who orchestrated meetings of the White House’s coronavirus task force meetings.

Aides were traveling regularly, attending large meetings and rarely wearing masks, Troye said, which made her uncomfortable. “Some of these offices are like closets, with people sitting on top of each other,” Troye said.

“The fact of the matter was, 75 percent did not walk around with masks. Maybe 85 percent,” she said. “It was a very small percentage of people who wore the masks all the time.”

One of Trump’s top advisers on the pandemic — Scott Atlas, a neuroradiologist — has regularly appeared at events without a mask since joining the White House team in August.

The same cavalier attitude seemed to be shared by Trump’s family — especially his adult sons.

Donald Trump Jr., for instance, spoke to a crowded ballroom of his father’s supporters in Chandler, Ariz. last month, and reporters at the event said that neither he nor the majority of the crowd wore a mask.

Eric Trump used social media to post photos of himself mingling maskless at Trump golf clubs and campaign venues alike. Last month, Eric Trump posted a photo of himself arm-in-arm with new U.S. Open golf champion Bryson DeChambeau. Two days later, he posted a video of himself squeezing together for a group selfie with Trump supporters in Arizona. That group seemed to be violating several coronavirus guidelines at once: They crowded into a tight bunch, no face-coverings, while someone led them in a cheer.

Trump’s eldest daughter Ivanka — now a White House staffer — has done more than her brothers to urge Americans to take precautions against the coronavirus.

On March 29, as lockdown orders went into place nationwide, Ivanka Trump recorded an Instagram video urging Americans to practice social distancing.

“For those lucky enough to be in a position to stay at home: Please, please, do so,” she said in the video. “Each and every one of us plays a role in slowing the spread.”

But in private, she seemed to defy her own advice.

Secret Service records obtained by The Washington Post show that — despite that public plea — Ivanka Trump left her home in Washington four days later to travel to her father’s Bedminster, N.J., club. The records show 11 different trips to Bedminster by her or her husband, Jared Kushner, a White House adviser, between April 2 and May 28, while both Washington and New Jersey were under “stay at home” orders.

A spokeswoman for Ivanka Trump declined to comment about those trips, and a spokesman for Kushner did not respond to emailed questions.

Secret Service agents accompanied their family to the club. Among some of those agents, there was concern that Ivanka Trump’s decision to leave home had increased their risk of exposure to the coronavirus. There was no routine testing for the disease among agents assigned to the club, and agents said they were rebuffed by superiors when they asked for ultra-protective N95 masks, according to two people familiar with those discussions. Like others, the people spoke on the condition of anonymity because they were not authorized to speak publicly.

Some agents on the president’s detail at Bedminster, taking their cues from the president himself, did not routinely wear masks at all, two government officials said.

The Bedminster club’s members also seemed to take their cues from Trump: in August, when Trump gave a news conference from the club, maskless guests crowded together to watch — despite a state order that private buildings “require individuals to wear face coverings when in prolonged proximity to others.”

“They’re living in an alternative reality,” said one regular visitor to the club, describing how little things had changed inside. “You would never know anything’s going on,” from looking at the members, the person said.

“The Secret Service has well established COVID-19 protocols in place and continues to take every precaution to keep our protectees, employees and families, and the general public, safe and healthy,” the Secret Service said in a statement. The agency declined for security reasons to say how many agents had tested positive for the virus and how many were in quarantine.

“Since the beginning of the pandemic, the Secret Service has been coordinating with all of our public safety partners, the medical community and the White House Medical Unit,” the statement said. “We follow Center for Disease Control and Prevention protocols to include testing, conducting contact tracing related to confirmed and suspected exposure, and immediate isolation of any employee who tests positive for COVID-19.”

Thursday night, it turned out, was the last night that Trump’s alternate reality held up. The president visited the club for a fundraiser — speaking to a smaller group of donors around a table indoors, then addressing a larger crowd outside. The president did not wear a mask, though some attendees did, according to people who were present.

“It was mostly the same stuff you hear him say on TV,” said Keith Frankel, a vitamin executive who attended.

By the next day — after Trump’s positive test — the bubble was gone, replaced by worries and questions from the county health department. The president who had downplayed the coronavirus threat for so long was now at the center of a process many Americans outside his bubble were already familiar with: contact tracing.

“As a first step, the county has reached out to Trump National Golf Course with a request for lists of facility staff, event participants, and other people” who came into contact with the president and first lady, a county spokesman said in a news release.

Back at the White House on Friday, however, there were signs that Trump’s inner circle would still resist change — even after this. Officials said that, even after the president’s diagnosis, masks would continue to be optional in the West Wing.

Bob Woodward contributed to this report.