President Trump delivered a scathing and wholesale attack on Democrat Joe Biden and fiercely defended his stewardship of a nation buffeted by historic crises on Thursday night, appealing to voters for a second term in an election he said would either preserve or destroy the “American way of life.”

In formally accepting the Republican presidential nomination from the South Lawn of the White House, Trump cast himself as an insurgent rather than the incumbent he is, railing against Biden as eminence of “the failed political class.” He blamed the former vice president and his Democratic Party for the nation’s chronic socioeconomic problems as well as for the anger and unrest coursing through the country today.

“This is the most important election in the history of our country,” Trump said. “This election will decide whether we save the American Dream or whether we allow a socialist agenda to demolish our cherished destiny.”

He added, “Your vote will decide whether we protect law-abiding Americans or whether we give free rein to violent anarchists, agitators and criminals who threaten our citizens. And this election will decide whether we will defend the American way of life or whether we allow a radical movement to completely dismantle and destroy it.”

Trump’s speech capped the four-day quasi-virtual Republican National Convention and was delivered against a remarkable and unprecedented tableau — “the People’s House” transformed for an evening into a campaign rally site.

Trump spoke from a red-carpeted stage adorned with American flags and bookended by massive campaign signage, with the White House’s grand portico illuminated against the night sky as his backdrop. After his 70-minute speech, among the longest acceptance speeches in history, fireworks exploded over the Mall, some of the blasts bearing the president’s name, T-R-U-M-P.

And as the coronavirus pandemic still rages coast to coast, an estimated 1,500 guests gathered on the South Lawn flouting social distancing recommendations and mostly forgoing face masks exemplifying the convention’s aim to falsely portray the virus as fading away.

The president punctuated his party’s dark, dystopian warnings that Biden is beholden to the far-left wing of the Democratic Party — “a Trojan horse for socialism,” he said — and, if elected, would transform America’s democracy into something dangerous and sinister.

“Joe Biden is not the savior of America’s soul; he is the destroyer of America’s jobs — and, if given the chance, he will be the destroyer of American greatness,” Trump said.

Later, invoking Biden’s two terms as vice president and nearly four decades in the Senate, Trump added, “We have spent the last four years reversing the damage Joe Biden inflicted over the last 47 years. Biden’s record is a shameful roll call of the most catastrophic betrayals and blunders in our lifetime. He has spent his entire career on the wrong side of history.”

Trump’s speech came at a moment of piercing pain for a country convulsing anew over continued racial conflict. Sunday’s police shooting of Jacob Blake, a 29-year-old Black man, in Kenosha, Wis., reignited mass protests and led to an unprecedented boycott by professional athletes in protest of racial injustice.

The agonizing and continuing reckoning over race was only one of the crises Trump confronted in his address. He argued that, despite the wreckage on his watch, he could lead the country out of the pandemic and bring back the tens of millions of jobs lost in the accompanying recession.

“Our nation, and the entire planet, has been struck by a new and powerful invisible enemy,” Trump said. “Like those brave Americans before us, we are meeting this challenge. We are delivering lifesaving therapies, and will produce a vaccine before the end of the year — or maybe even sooner. We will defeat the virus, end the pandemic and emerge stronger than ever before.”

By contrast, Trump argued, “Joe Biden’s plan is not a solution to the virus, but rather it’s a surrender to the virus.”

By positioning himself as best equipped to see the country out of this year of catastrophe, Trump reprised a signature argument from his Republican convention address in 2016, when the first-time candidate declared, “I alone can fix it.” In that speech four years ago in Cleveland, Trump painted a dire portrait of America as lawless and terrorized, and overrun with immigrants — similar to the one he says Biden would create should he become president.

Trump used his speech Thursday to defend his management of the pandemic, which continues to ravage the country for the eighth straight month and has claimed the lives of at least 177,000 people in the United States. The number of deaths and continued spread of cases in this country vastly outpaces every other nation.

The Democrats delivered a sustained assault on Trump’s handling of the pandemic at their convention last week. Some Republican convention speakers sought this week to counter that argument by asserting that the president did the best he could and saved lives — at times relying on false or misleading claims.

Biden and his running mate, Sen. Kamala D. Harris (D-Calif.), both gave forceful rebukes of Trump’s handling of the pandemic and of race relations on Thursday, effectively prebutting the president’s address in afternoon appearances.

Harris delivered a systematic indictment of what she called the president’s “catastrophic” mismanagement of the virus. The former prosecutor marshaled evidence as if in a courtroom to argue that Trump had demonstrated “reckless disregard for the well-being of the American people” by failing to take the coronavirus more seriously in January and February.

“Instead of rising to meet the most difficult moment of his presidency, Donald Trump froze,” Harris said. “He was scared, and he was petty and vindictive.”

Trailing Biden in most national and battleground-state polls, Trump planned to use his convention appearance not only to galvanize his most loyal supporters but also to attempt to expand his coalition with an appeal to more moderate voters.

That includes college-educated White women in suburban areas who helped lift Trump to victory in 2016 but abandoned the Republican Party in the 2018 midterms, and who many of this week’s convention messages have targeted. Trump’s eldest daughter, Ivanka, a senior White House adviser who is seen by the Trump team as having particular appeal with female voters, introduced her father.

Ivanka dubbed Trump “the people’s president,” claiming that he governs with “common sense” and has been “fighting for you from dawn til midnight, when the cameras have left, the microphones are off and the decisions really count.” She gave a full-throated endorsement of his accomplishments and praised him as a bipartisan dealmaker trying to heal the nation — despite his record of partisan acrimony with Congress, a logjammed legislative agenda and repeated efforts to pit groups of people against each other.

As seen earlier this week, Thursday’s lineup of speakers included several who served as character witnesses seeking to soften Trump’s rough edges on issues of race, empathy and compassion.

“Many on the other side love to incite division by claiming that President Trump is a racist. They could not be more wrong,” said Housing Secretary Ben Carson, the only Black member of Trump’s Cabinet.

Alice Johnson, who also is Black, delivered one of the convention’s more emotional speeches as she described her personal journey in prison, where she served a lifetime sentence until Trump granted her a pardon.

“I was once told that the only way I would ever be reunited with my family would be as a corpse,” Johnson said. “But by the grace of God and the compassion of President Donald John Trump, I stand before you tonight — and, I assure you, I’m not a ghost. I am alive, I am well, and most importantly, I am free.”

In his own remarks, Trump declared, “I say very modestly that I have done more for the African American community than any president since Abraham Lincoln, our first Republican president. And I say that I have done more in three years for the Black community than Joe Biden has done in 47 years.”

The unrest in Kenosha has played out all week in a split screen from the Republican convention. Democrats have pointed to the shooting as evidence of systemic racism, and the resulting outpouring of anger and unrest as the consequence of a president who refuses to acknowledge it. A White teenager, Kyle Rittenhouse, has been charged with first-degree intentional homicide after two people were killed and another seriously wounded by gunfire at the demonstrations.

Republicans, meanwhile, have argued that the protests play in their favor, evidence that “law and order” must be maintained, as Trump has vowed to do.

“The more chaos and anarchy and vandalism and violence reigns, the better it is for the very clear choice on who’s best on public safety and law and order,” Kellyanne Conway, Trump’s departing senior counselor, said Thursday on Fox News Channel.

Vice President Pence, in his address Wednesday night to the Republican convention, invoked protests in Kenosha, as well as recent demonstrations in Minneapolis and Portland, Ore., to argue that Biden would “double down on the very policies that are leading to violence in American cities.

“The hard truth is you will not be safe in Joe Biden’s America,” Pence continued.

Biden responded Thursday to Pence’s charge by noting that the tumult is occurring during Trump’s presidency.

“The problem we have right now is we’re in Donald Trump’s America,” Biden said in an interview with MSNBC anchor Andrea Mitchell. “What’s he doing except pouring gasoline on the fire? This happens to be Donald Trump’s America.”

Trump has said little about the incident in Kenosha. But in his remarks Thursday night, the president warned that a Biden presidency would “demolish the suburbs,” “confiscate your guns” and “defund police departments all across America” — even though Biden has not proposed any of these policies.

“No one will be safe in Biden’s America,” Trump said.

“If the Democrat Party wants to stand with anarchists, agitators, rioters, looters and flag-burners, that is up to them, but I, as your president, will not be a part of it,” Trump added. “The Republican Party will remain the voice of the patriotic heroes who keep America safe and salute the American flag.”

The stagecraft of Trump’s various appearances at this week’s convention — especially his formal acceptance speech Thursday night — was designed to leverage the powers of incumbency and showcase him as president.

Trump has obliterated the line between governing and campaigning and tested legal boundaries this week, breaking the long-held norm of presidents not using the White House for overt political activities.

In a pair of remarkable pretaped scenes that aired as part of the Republican convention’s prime-time programming on Tuesday, Trump staged a naturalization ceremony for five new citizens as well as granted a pardon — both instances of the president performing his official duties inside the White House for convention cameras.

In addition, first lady Melania Trump used the White House Rose Garden as the backdrop for her convention address Wednesday night. And a number of government officials addressed the convention, including Secretary of State Mike Pompeo, who spoke from Jerusalem, where he was traveling on a taxpayer-funded diplomatic mission.

The White House has maintained that these activities have been legally permissible.

Whereas Democrats orchestrated an entirely virtual convention, in strict adherence to social distancing and other public health guidelines and with the aim of modeling best practices, the Republican convention was a hybrid between a virtual program and a traditional convention in a packed arena.

The marquee Republican speeches were staged before live audiences, including Pence’s address Wednesday night from Fort McHenry in Baltimore, where most attendees sat outdoors relatively closely together without wearing masks.

Trump’s crowd on Thursday was the largest of the week, with an estimated 1,500 people gathered on the South Lawn. The Trump campaign told reporters that the Republican National Committee worked with Patronus Medical, a medical, safety and health company, to institute “proper protocols” in compliance with Centers for Disease Control and Prevention guidelines to ensure the safety of attendees.

But an overwhelming majority of the attendees were not expected to be tested for the novel coronavirus, and chairs were placed only inches apart in defiance of distancing guidelines.

Josh Dawsey, Chelsea Janes, Felicia Sonmez and John Wagner contributed to this report.