An already chaotic presidential campaign was thrown into even more confusing and volatile territory by President Trump’s positive coronavirus test and hospitalization Friday, leaving the final month of the race unpredictable and the remaining debates in a state of uncertainty.

Trump, a president who thrives on rallies to energize supporters and communicate his unorthodox message, has been forced off the campaign trail for an unknown stretch. And as a candidate whose strategy centers on downplaying the disease, contracting it himself presents a daunting challenge.

Democrat Joe Biden faces his own delicate balance, as he pushes ahead with his campaign and continues in-person appearances while seeking to avoid appearing insensitive to the president’s condition. The Biden campaign is suspending its negative advertising aimed at Trump, according to a campaign official with knowledge of the move who was not authorized to discuss it publicly.

The two remaining presidential debates remained in limbo Friday, and the terms of Wednesday’s vice-presidential faceoff in Utah were still being negotiated after the Biden campaign pushed for additional safety measures. Both Vice President Pence and Sen. Kamala D. Harris (D-Calif.), Biden’s running mate, recently tested negative for the virus and plan to continue holding events.

Biden traveled to Grand Rapids, Mich., on Friday after testing negative for the virus earlier in the day, despite lingering questions about his exposure to Trump at Tuesday’s debate. He opened his remarks by saying he was “sending my prayers for the health and safety of the first lady and president of the United States after they tested positive for the coronavirus.”

He appeared to be sending a pointed message by leaving on his mask for the entirety of his remarks, instead of taking it off once he started speaking as he usually does.

“This is not a matter of politics,” Biden said of Trump’s diagnosis. “It’s a bracing reminder to all of us that we have to take this virus seriously.”

Behind the scenes, both campaigns were struggling to adjust to the historically unprecedented event of a presidential candidate — let alone the incumbent — contracting a potentially deadly infectious disease just weeks before Election Day.

The coronavirus has been a central issue in the campaign, with Biden sharply criticizing Trump’s handling of the pandemic and Trump mocking Biden’s safety precautions. The president’s illness could undercut one of the central messages of his campaign.

The president will remain at Walter Reed National Military Medical Center for a few days, the White House said Friday. Campaign manager Bill Stepien said all of Trump’s previously announced campaign events would be conducted virtually or postponed, as would events featuring his family. His advisers had earlier mapped out an extensive travel schedule for the campaign’s final stretch, including events in Florida, Wisconsin and Arizona.

“The campaign office remains open and our nationwide team will continue with our efforts to reelect President Trump,” Stepien wrote in a memo to staff.

Stepien asked campaign workers who’d had contact with someone testing positive to immediately self-quarantine, and those without such contact to wear a mask, wash their hands and practice social distancing, guidelines that have long been applied unevenly by the Trump operation.

Trump campaign officials Friday were already discussing how he could appear in public safely, with some raising concerns about the financial impact of Trump’s inability to travel to fundraisers.

The president’s stump speech, meanwhile, had evolved to focus on the economy and the vacancy on the Supreme Court while giving a more hopeful message on the virus, an approach that may now be problematic. His allies were privately frustrated that the diagnosis would bring the worst story line for the president — his handling of the coronavirus — back to the fore.

On Wednesday, at a rally in Duluth, Minn., Trump had delivered his usual upbeat message. “We had the greatest economy in history and we had to close it down because we would have lost millions of lives,” he said. “Now we’re opening it up and we’re doing it at a level like nobody’s ever seen before, and it’s a great thing, and we’re going to be back in business very soon.”

After news of Trump’s diagnosis Friday, the Minnesota Department of Health urged anyone who had direct contact with Trump during his visit to self-quarantine and get a test five to seven days after the interaction, saying that also applied to anyone who attended the Duluth rally and developed symptoms.

Trump’s rally in Minnesota occurred after the head of the Republican Party, Ronna McDaniel, had also tested positive for the virus. A Republican official said Friday that McDaniel received her result Wednesday afternoon, after another member of her family tested positive.

McDaniel, who appeared remotely for a television appearance on Fox News on Thursday, waited more than a day to make her infection public. “She has been at her home in Michigan since last Saturday,” read a statement released by the Republican National Committee. She had attended a fundraiser with Trump on Sept. 25.

For Biden, the development presented a different set of challenges. He could be buoyed as the candidate who has stressed caution and preventive measures from the outset, while Trump mocked Biden’s decision to limit his campaigning and wear a mask, in addition to downplaying the pandemic’s effect on the country.

But Biden had started traveling more regularly and his campaign had begun door knocking in some areas after criticizing the Trump campaign for doing so. His allies signaled Friday that they do not expect major adjustments to his strategy.

The Trump campaign dismissed Biden’s decision to suspend negative advertising. “Joe Biden used his speech in Michigan today to attack President Trump. He’s in no position to say anything,” said Trump campaign spokesman Tim Murtaugh. In his speech, Biden criticized the handling of the pandemic and the state of the economy.

Hilary Rosen, a Democratic strategist with close ties to Biden’s team, said the prevailing emotion in Biden’s orbit was frustration at Trump. “I sense this kind of anger that this could have been prevented. Nobody is gleeful about this. They are mad,” Rosen said.

Biden advisers on Friday morning were taken aback by the news, but regular campaign calls went forward. The two candidates had appeared on the same stage, about 12 feet apart, for 90 minutes at Tuesday’s debate.

Irwin Redlener, a physician who directs the National Center for Disaster Preparedness at Columbia University, said that while federal health guidelines recommend quarantining after being within six feet of someone who tests positive for 15 minutes, the science is less settled on longer contact at a greater distance.

“Theoretically, Biden could have been at risk,” said Redlener, who has advised the Biden campaign. “But if the Biden campaign continues its policies of keeping separated, with everyone wearing masks and using all the hygiene, I think that’s okay.”

Biden allies on Friday defended his decision to hit the campaign trail again, even though his negative test was not dispositive proof that he had not contracted the virus.

“I don’t think it’s a great risk going to Michigan,” said Steve Westly, a California investor who is raising money for Biden. “I think Biden’s been careful from day one and the president less so.”

Trump’s positive test result set off a flurry of new negotiations over the terms of the vice-presidential debate scheduled for this Wednesday. Pence and Harris were expected to sit about seven feet from each other at a table, but the Biden campaign is now pushing to place both candidates behind lecterns around 13 feet apart, according to a person familiar with the debate discussions who was not authorized to describe them.

“The pressure is on the commission to err on the side of safety right now,” said the person, adding that Pence’s team is resisting the change. The Biden campaign also wants contact tracing for members of Pence’s staff who might attend the debate after being exposed at the White House.

Trump and Biden are scheduled to take the debate stage again on Oct. 15 in Miami, but Biden’s team is expecting that event to be delayed.

Frank J. Fahrenkopf Jr., the co-chair of the Commission on Presidential Debates, said Friday that the status of the debates has not been settled.

“Our people are on the ground in Salt Lake City,” he said, referring to the site of the vice-presidential debate. “We’re going to proceed. We don’t have any comment. We’re moving ahead.”

Several Democrats who attended Tuesday’s debate announced negative test results on Friday, including Sen. Christopher A. Coons (D-Del.), Rep. Lisa Blunt Rochester (D-Del.) and Democratic National Committee Chairman Tom Perez.

Harris, Biden’s running mate, tested negative on Thursday as part of the campaign’s routine monitoring of principals, according to a Harris aide. She and her husband, Doug Emhoff, were tested again on Friday morning. Both tested negative, the aide said, and planned to continue with events in Las Vegas and Greensboro, N.C.

Kristin Urquiza, who sat in the front row as one of Biden’s guests for the debate, sharply criticized Trump and his family for not wearing masks.

“The Trump family exposed every attendee at the debate: guests, workers, members of Congress, Secret Service agents, members of the media, and janitors to a deadly virus that has killed 205,000 Americans to date,” she said.

Urquiza was invited to the debate to represent her father, who died in June at age 65, and she has co-founded a group called Marked By Covid. She said she is working to get tested as soon as possible and would self-quarantine until she knew she wasn’t putting others at risk.

“I am terrified,” she said.

Rep. Tim Ryan (D-Ohio), who was also in the debate hall Tuesday, similarly expressed anger the Trump entourage’s refusal to wear masks at the event. On the Biden side of the debate hall, everyone was wearing masks, he said.

He expressed frustration that the debate commission did not enforce mask-wearing by Trump’s family and advisers. “The rules don’t apply to them,” Ryan said.

Former Pennsylvania governor Ed Rendell, a close Biden ally, said in an interview Friday that because the former vice president has been taking appropriate precautions all along, he does not need to change anything in the wake of Trump contracting the virus.

“I think the most important thing that they can do is continue doing what they’ve been doing,” Rendell said.

The former governor and other Pennsylvania allies held a previously scheduled virtual fundraiser Friday afternoon that had raised $5 million in advance. But Biden scrapped his planned appearance due to “events of the day,” Rendell told donors who gathered on Zoom.

Sean Sullivan, Annie Linskey, Toluse Olorunnipa and Chelsea Janes contributed to this report.