WASHINGTON — Two weeks ago, Bernie Sanders was the Democratic presidential front-runner, the U.S. economy was humming and President Donald Trump had reason to be optimistic about his re-election prospects.

Then the first American died from the coronavirus. The campaign as we knew it would soon be over.

The pandemic subsumed businesses and sports leagues, hammered the travel industry and caused some analysts to project an economic downturn, if not a global recession. Democrats who rated the coronavirus as important to their vote picked former Vice President Joe Biden by wide margins in primary contests, padding his victory margins and handing him a commanding delegate lead.

The president and his two main rivals canceled rallies, allowed or directed staff to work from home and began shifting their events to online gatherings. Democrats moved their Sunday debate from Phoenix to Washington and eliminated the live audience, while Louisiana became the first state to postpone its primaries due to the virus. American public life was grinding to a halt.

In the nation’s capital, Trump struggled to contain the fallout, initially downplaying the magnitude of the crisis and offering mixed messages that went against guidance from public health officials.

The coronavirus outbreak has challenged Trump as he has never been challenged before. The scorched-earth playbook that has gotten the former reality TV star out of trouble in the past is failing on a complex problem that requires technocratic competence and expertise. A president who has confounded his critics with an apparent invincibility in one crisis after another now sees the virus attacking his two biggest assets heading into re-election — a growing economy and the approval of older Americans, whose lives are disproportionately threatened.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

“He’s been able to bulls--- his way out of a lot of jams, but this is not that,” said one senior congressional Democratic aide.

In the last two weeks, Trump’s approval rating has ticked downward, and his handling of the coronavirus has rated in the low-to-mid 40s. He underperforms his rivals on the question of who would better handle a crisis: American voters picked Joe Biden over Trump by 16 points, and Sanders over Trump by 6 points, a Quinnipiac poll said.

This week, the president delivered an Oval Office address that misstated his own policy of restricting travel from Europe, which panicked Americans abroad and further tanked the markets. On Friday, one day after the worst stock market crash since 1987, he declared a national emergency in order to unlock resources to help states and localities address the pandemic. He denied responsibility for the slow rate of coronavirus testing.

"No, I don’t take responsibility at all," he told reporters at a White House press conference, blaming the "set of circumstances" he inherited, flanked by administration officials and corporate executives enlisted to help mitigate the crisis. Hours later, House Speaker Nancy Pelosi announced a deal with the administration on a bill to protect Americans with two weeks of paid sick leave, three months of family and medical leave, enhanced unemployment benefits and a boost in Medicaid and nutrition funding.

Before Trump came around to declaring an emergency, he latched onto the rosiest forecasts and sought to blame his predecessor, attack the press and accuse Democrats of perpetuating a “hoax” to bring down his presidency. Meanwhile, the death toll has gradually risen, testing remains scarce compared to other developed countries and the president’s response has fueled criticism that he’s more worried about his political health than the public's.

“The administration’s failure on testing is colossal, and it’s a failure of planning, leadership and execution,” Biden said in remarks on the crisis Thursday. “We must know the true extent of this outbreak so we can map it, trace it and contain it. Nor should we hide the true number of infections in hope of protecting political interest or the stock market.”

Biden’s speech came one day after the president’s Oval Office address, offering Americans a visual comparison of how their two most likely options this fall would act in a crisis. Voters in recent general elections have not necessarily been drawn to the candidate with the most governing experience — Hillary Clinton, John McCain and John Kerry all lost — but a pandemic could change that.

Sanders said Friday the virus “has radically changed our campaign,” by preventing him from hosting big rallies and relegating his staff to work from home. He touted his signature issue of “Medicare for All” and argued that a national insurance plan would make the U.S. better equipped to combat public health threats like the coronavirus.

“We need fundamental changes to our economy, we need fundamental changes to our health care system,” he told reporters in Burlington, Vermont. “I would hope that this crisis should be a moment in which people ask fundamental questions about the dysfunctionality of our current health care system.”

At his press conference Friday, Trump sought to look ahead to the light at the end of the tunnel.

"This will pass," he said. "This will pass through and we're going to be even stronger for it.'

He — and the nation — can hope.