As the novel coronavirus spreads through communities across the country, it poses a critical question: Can America’s people, institutions and government collectively rise to the occasion to defeat a once-in-a-generation crisis?

With a global pandemic testing the country’s political, financial, social and moral fabric, there are growing signs that answering in the affirmative has become increasingly difficult.

Bureaucratic missteps have led to a shortfall in tests needed to determine the true scope of the virus. Hospitals are pleading for more medical equipment as doctors resort to using homemade masks. Financial markets have lost a third of their value in less than a month. Reveling spring breakers have hit the beaches in defiance of a nationwide social distancing campaign.

Companies, some of which celebrated tax cuts by rewarding shareholders with record stock buybacks, are preparing to lay off millions of workers while pleading for a government bailout.

At the helm of it all is a president who rose to power with a divisive brand of politics, a reliance on his gut instinct and a claim that the United States was no longer winning on the global stage. He now faces the greatest test of his presidency — a viral outbreak that requires bipartisan cooperation, verbal precision and a reliance on bureaucratic expertise.

The president has vacillated in recent days between trying to strike a reassuring tone and lashing out at his perceived enemies while criticizing the press, seeming at times to view the public health emergency through the prism of his media coverage.

“This is a challenging time for all Americans. We’re enduring a great national trial, and we will prove that we can meet the moment,” he said at a briefing Sunday. “I want to ensure the American people that we’re doing everything we can each day to confront and ultmiately defeat this horrible, invisible enemy. We’re at war.”

But later, he made a seemingly callous remark after being told Sen. Mitt Romney (R-Utah), who voted to convict Trump on an impeachment charge, was under self-quarantine because of his exposure to Sen. Rand Paul (R-Ky.), who has tested positive for the virus.

“Romney’s in isolation,” he said. “Gee, that’s too bad.” When asked whether he was being sarcastic, Trump said he wasn’t, but his demeanor suggested otherwise.

Throughout U.S. history, there have been moments that have tested the nation’s ability to overcome monumental challenges ranging from war to economic depression to natural disasters. Many of those were accompanied by controversies, a sense that more could have been done, and unequal treatment across racial and economic lines.

Still, etched into the public consciousness is a sense that the country that had rallied to the moment in previous crises would inevitably do so in the face of a new one.

Little was automatic about those historic victories, and a sharpening partisan divide combined with flagging confidence in the government and other institutions could hamper any effort to quickly solve what is fast becoming a debilitating national emergency.

“We hit dark moments before in U.S. history, and this is clearly one of them,” said Douglas Brinkley, a historian at Rice University. “It doesn’t help that the federal government is perceived as utterly dysfunctional.”

But, Brinkley added, Americans throughout the country have shown impressive mettle in dealing with a virus that has upended the daily lives of hundreds of millions of people, and they could rise to the moment even more as the threat posed by the virus becomes more real to communities across the country.

Hospital workers are treating thousands of patients during day-long shifts. Healthy people are volunteering to help their vulnerable neighbors with everyday tasks. Most Americans are abiding by instructions to stay home, a reality perversely highlighted by the abrupt slowdown in the economy.

The Trump administration has flexed the power of the federal government to take several unprecedented steps, including some with bipartisan support, such as suspending student loan payments and foreclosures and providing tax relief to strained consumers. Legislation to combat the crisis and its economic fallout has moved with breakneck speed in a political climate that had been plagued by gridlock, impeachment and petty fights.

While Trump initially downplayed the threat of the outbreak, in recent weeks, he has interspersed his trademark bombast and braggadocio with occasional flashes of sobriety and inclusiveness.

Many governors have stepped in to fill the perceived leadership void in Washington.

The times of struggle show no sign of abating, as the country braces for what could be a prolonged period of social and economic disruption caused by a mysterious virus. There were more than 30,000 confirmed cases across the nation as of Saturday evening, and more than 400 people have died.

Those numbers have been rising rapidly even as some countries, including South Korea, have appeared to gain control over the outbreak’s spread in a way that shines a harsh light on some of the shortcomings in the U.S. response. The Trump administration is scrambling to replicate some of the tools and systems successfully put in place weeks ago by South Korea.

Whether it is able to do so could shape how Trump’s presidency, and the country’s welfare during it, are remembered, said Monica Schoch-Spana, a medical anthropologist at the Center for Health Security at the Johns Hopkins Bloomberg School of Public Health.

“We’re at a fork in the road, and the choices we make now are going to put us down at least one of two pathways,” said Schoch-Spana, who has studied the response to the 1918 flu outbreak, which killed at least 50 million people globally. “We need to pull it together, like, right now.”

A system on the brink

The health-care system is the area of most urgent need, according to hospital workers, state governors and public health experts who have been sounding the alarm about shortages in equipment and test kits. As the federal government struggles to provide basic medical equipment such as masks and ventilators, some governors have warned that a shortage in capacity could become acute in a matter of days.

Frustration with the federal response began early, as a bureaucratic morass delayed the distribution of testing kits for people who needed them.

As Trump assured the country that “beautiful” tests were available to anyone who needed them earlier this month, members of his administration — and the facts on the ground — offered a very different picture. Anthony S. Fauci, director of the National Institute of Allergy and Infectious Diseases, described the inability to conduct widespread screening for the coronavirus as “a failing.”

The White House has defended Trump’s handling of the crisis.

“The bold and decisive actions this President has taken throughout this pandemic are purely about protecting the public health, including the unprecedented collaboration to curb the spread of the virus, expand testing capacities, and expedite vaccine development,” White House spokesman Judd Deere said in a statement.

Doctors are still struggling to get access to enough tests, and state health officials have only begun to set up the kind of easy drive-through testing that South Korea implemented more than a month ago before it halted the spread of the outbreak.

Now, a lack of medical protective gear — the masks, gowns and gloves that health providers rely on to keep themselves healthy — has threatened to further worsen the crisis. The Centers for Disease Control and Prevention has encouraged some health officials to use bandannas as “a last resort” if they don’t have masks.

Hospitals are also struggling to obtain enough ventilators for an expected surge in serious medical cases. Trump invoked the Defense Production Act on Wednesday, drawing on wartime powers meant to ramp up production of key materials. But he wavered on whether he would use the authority granted by the 1950 act, and it’s not clear whether his actions will be adequate to address the shortfall.

Trump has distanced himself from the responsibility to ensure medical equipment is available within the health system, saying state governors should take the lead.

“We’re not a shipping clerk,” the president said Thursday.

The shortages, which bring to mind previous wartime efforts to rapidly ramp up production of critical supplies, highlight how much has changed since World War II, Brinkley said.

They also underscore long-standing problems with the health-care system and the lack of preparedness that has resulted from years of governmental neglect, said Saskia Popescu, an epidemiologist with Honor Health, a Phoenix hospital system.

“This outbreak has revealed systemic weaknesses, but also the challenges of national preparedness built on private industry and how that often means some hospitals are more prepared than others and the desperate need to really strengthen national health-care biopreparedness,” she said.

A deeply divided Congress

In Congress, lawmakers were rushing to come to an agreement as early as this weekend on an economic stimulus plan that could inject nearly $2 trillion into the economy under circumstances unprecedented in modern history at a Capitol that has been riven by increasingly toxic partisanship.

Many of the crises confronted by lawmakers dating to the Obama administration have been of Congress’s own making, such as government shutdowns fueled by partisan impasses over spending priorities. The Trump presidency and Democrats’ subsequent takeover of the House had further embittered the relationship between the two branches, as the House made Trump only the third president to be impeached. He was later acquitted by the Senate.

Yet under the pressure of the pandemic, lawmakers in recent weeks sped to pass two initial funding packages in overwhelmingly bipartisan numbers aimed at addressing the coronavirus crisis.

The question remained on whether they could reach agreement on a third — a complicated economic stimulus package with a massive price tag that was already drawing fire from all sides. Senior aides expressed cautious optimism that lawmakers could, as the scale of the historic crisis continues to grow and senators become more eager to leave the Capitol, particularly after Paul and two House lawmakers tested positive for the coronavirus in recent days.

Senators also said they acknowledged acutely the gravity of the moment.

“I think there’s a sense that we’re all going to be remembered for this moment,” said Sen. Richard Blumenthal (D-Conn.). “If we’re there for any purpose, now is it.”

“I think this is a test of America’s character, just like it was a test of our character in World War II to pull together,” Senate Finance Committee Chairman Charles E. Grassley (R-Iowa) said last week on the Senate floor.

The Senate’s current longest-serving Republican agreed.

But partisan tensions remain.

Senate Majority Leader Mitch McConnell (R-Ky.) soured Democrats early on in the negotiations when he released legislation drafted solely by Senate Republicans filled with several provisions that were nonstarters for Democrats — whose votes are needed to pass any legislative package in the Senate — and even some GOP senators.

“The only way we will get this done, in a divided government, is to negotiate in good faith,” said Sen. Brian Schatz (D-Hawaii), questioning whether his GOP colleagues were capable of bipartisanship after years of acrimony.

Congress’s ability to meet the moment was undermined by reports Thursday that several senators offloaded large portions of their stock holdings in February, when lawmakers had received briefings about the threat of the virus and before those shares ultimately tanked.

Senate Intelligence Committee Chairman Richard Burr (R-N.C.), who had expressed confidence in the country’s preparedness for the coronavirus outbreak, sold a significant share of his stocks last month, according to public disclosures.

Burr and other senators have denied any wrongdoing.

The each-man-for-himself attitude that the stock-selling senators are accused of has been replicated in parts of the country where enforcing social distancing has become a kind of moral dilemma.

The greater good

Along Florida’s sun-kissed shores, authorities had to physically close off beaches to rowdy spring breakers after they failed to take the hint from earlier orders to avoid crowded spaces. Many simply moved the party to nearby bars and restaurants before they, too, were ordered shut.

Older Floridians have looked on from their seaside condos in dismay, wondering why young people aren’t taking the threat more seriously.

But the nation’s baby boomers have hardly been immune to rule flouting.

California’s Bay Area has imposed some of the most restrictive conditions in the country, with authorities ordering residents to stay indoors on Monday. Gov. Gavin Newsom (D) made the edict statewide on Thursday.

Not everyone has been willing to adhere, however, to demands that residents go out only for essentials, such as trips to the grocery store or the doctor. Images of Californians, of all ages, casually mixing and holding hands on the San Francisco waterfront, were enough to send the normally unflappable Sanjay Gupta, CNN’s resident doctor, into a simmering rage.

“How I behave affects your health,” he intoned on air, offering a mantra for our times. “How you behave affects my health.”

It’s a way of seeing the world that has quickly been internalized by many millions. The oblivious spring breakers received a lot of attention. But the broader U.S. response has included much generosity and sacrifice as workplaces empty, crowds scatter, neighbors help neighbors and people give up, one by one, the things that they love for the sake of the greater good.

Many Americans have acted preemptively to protect those around them. Days before California ordered bars and restaurants to shut down, Miguel Jara, owner of the iconic La Taqueria in San Francisco’s Mission District, announced he was closing up.

He didn’t want his 19 employees, some of whom have been cooking up tacos for decades, to be exposed to the virus. He said he would keep paying them while the restaurant remained closed.

“I’d rather take a hit in the bank account than have one of them get sick,” said the 77-year-old, who has been in business nearly half a century.

Louisville Mayor Greg Fischer said the fact that everyone is confronting the same problem is a hindrance: No one has been spared the impact, making money tight and resources scarce. But it also helps for everyone to be in it together.

“There’s a commonality: Every person, every business, every nonprofit is dealing with it,” said Fischer, who’s been in quarantine after his wife tested positive. “The whole country is focused on covid-19.”

While the virus has captured the nation’s attention, Americans getting their news from widely varying sources are being exposed to different versions of reality. Some conservative figures downplayed the virus for weeks, joining Trump to describe concern over its spread as a plot to tarnish the president. Other kinds of misinformation have also spread widely on social media.

But more than ever, Silicon Valley’s most prominent social media sites are finding and removing misinformation and other dangerous posts, photos and videos about the coronavirus before they draw large audiences online.

Beginning in February, Facebook, Google-owned YouTube and Twitter each put a series of policies in place that prohibit content peddling fake cures, for example, and barring ads that peddle potentially suspicious masks and other preventive measures. They also have dedicated portions of their social feeds to banners and links that direct viewers to more authoritative sources, such as the Centers for Disease Control and Prevention.

The prevalence of misinformation makes presidential leadership and clarity all the more important in the middle of a national emergency, said Leon Panetta, who served as defense secretary and CIA director during the Obama administration.

“This president has been both ambivalent about how to approach this crisis, unsure about the strategy to deal with it and has not been able to, in an honest and direct way, unify the country behind this effort,” he said. “The leadership that is absolutely required by a president of the United States at a moment of this kind of serious crisis is lacking.”

Tony Romm contributed to this report.