A besieged President Trump, who was slow to treat the coronavirus as a serious threat as it has spread across the United States, announced a drastic emergency measure Wednesday night designed to save American lives from the pandemic.

Trump said the United States would ban all travel from Europe, where the virus has spread uncontrollably, for 30 days beginning Friday at midnight, although the president said the United Kingdom, which is an island yet still has reported hundreds of its own cases, would be exempt. The White House also later clarified that the travel restrictions do not apply to U.S. citizens and can be waived in multiple circumstances.

Although he read from a prepared script as he delivered a rare prime-time televised address to the nation from the Oval Office, Trump incorrectly described his own policy. The president said in his speech that the travel restriction from Europe would apply to cargo and trade as well as passengers. But the text of the order, later released by the White House, stated that the ban would not include cargo, allowing for continued trade between the continents to maintain the free flow of commerce.

Trump also urged all Americans to follow the guidelines of federal health experts — whose instructions he has contradicted or ignored in recent weeks. He said the government was moving “very quickly” to fix what has proved a chronic shortage of coronavirus test kits, yet he provided no specific information about how many Americans would be able to be tested, and when and where those tests could occur.

“If we are vigilant and we can reduce the change of infection, which we will, we will significantly impede the transition of the virus,” Trump said. “The virus will not have a chance against us. No nation is more prepared or more resilient than the United States.”

Trump outlined a menu of fiscal policies designed to shore up the sputtering economy, including offering loans to small businesses, allowing businesses and individuals negatively affected by the coronavirus to defer tax payments without interest or penalty. He also called on Congress to pass a payroll tax cut, which some Republican and Democratic lawmakers oppose.

Trump described the pandemic and the accompanying drops in the stock markets as “a temporary moment of time that we will overcome together as a nation and as a world.”

“We are at a critical time in the fight against the virus,” Trump said. Taking credit for his earlier restriction on travel to the United States from China, where the coronavirus originated, the president added: “We made a lifesaving move with early action on China. Now we must take the same action on Europe. We must not delay.”

A crisis that was never in Trump’s control has spiraled dangerously this week. On Wednesday, the World Health Organization declared the coronavirus a pandemic and Anthony S. Fauci, the director of the National Institute of Allergy and Infectious Diseases, declared that “it’s going to get worse.”

Panic over the coronavirus, which already is battering the airline, hotel and cruise industries, has had a devastating effect on the stock markets for days now. The Dow Jones industrial average fell nearly 1,500 points on Wednesday, reaching bear-market territory and an ending a historic 11-year expansion.

Since the first known case of coronavirus was reported in the United States on Jan. 21, Trump has addressed the matter with sporadic and slapdash comments. It took until Wednesday evening for the president to deliver a formal set of prepared remarks, with guidance for the public about what to do and assurance that the federal government is fully engaged in seeking to mitigate the crisis.

For the 11 minutes he addressed the nation Wednesday, Trump turned in a laboring performance — one intended to project calm competence that instead seemed to reveal uncertainty. Seated behind the Resolute Desk, the president struggled at moments to read the words on the teleprompter. He clasped his hands and twiddled his thumbs. He spoke with a curious affect, his voice sounding raspy and his delivery lacking the passion typically evident in his speeches.

“From the beginning of time, nations and people have faced unforeseen challenges, including large-scale and very dangerous health threats,” Trump said. “This is the way it always was and always will be. It only matters how you respond, and we are responding with great speed and professionalism.”

The stately Oval Office setting underscored the gravity of the crisis, but Trump’s demeanor made clear how hemmed in he has become. For weeks now, Trump’s handling of the growing crisis has invited intensifying criticism. He has contradicted the public health experts in his own government, spread misinformation, accused the media of overhyping the threat of the virus to hurt his presidency, sought to lay blame on Democrats and the Chinese, and erupted in private meetings with advisers.

The coronavirus is testing Trump’s governing philosophy that gut instinct is better than traditional expertise, that preparation and careful study is no match for impulse and luck. And the outcome is threatening his chief claim for a second term: a booming economy.

Historian Douglas Brinkley said he is surprised it has taken this long to do what so many other presidents have done at moments of national crisis.

“President Trump has been delinquent in not giving an Oval Office address about coronavirus until now,” Brinkley said. “Out of the gate he wanted to minimize the public health crisis, but the public is in no mood for blarney and improvisation. They’re just looking for empirical facts.”

In announcing the travel ban Wednesday, Trump’s focus on Europe, and specifically the European Union, fits with his neo-isolationist foreign policy ethos. Trump excluded Britain from the ban, which was both a nod to its historic alliance with the United States and the fact that Britain is no longer part of the European Union.

Although Trump has said as recently as this week that the news media and Democrats are overhyping the coronavirus as a means to damage his presidency, he did not repeat that claim Wednesday night. Instead, he sounded an inclusive note. “We are all in this together. We must put politics aside, stop the partisanship and unify together as one nation and one family,” Trump said, although when he has sounded similar notes in the past he has often followed them up with Twitter broadsides against his perceived enemies.

Shortly after the president spoke, White House press secretary Stephanie Grisham announced that “out of an abundance of caution” Trump would not travel to Nevada and Colorado as planned later this week for campaign fundraisers and a speech to the Republican Jewish Coalition.

Some of Trump’s advisers acknowledged privately this week that Trump has exacerbated the problem. The vacuum of leadership has created an opening for Vice President Pence, whom some governors credit with having a far steadier hand than Trump behind the scenes while also sounding more measured in the near-daily news briefings he has been conducting with Fauci and other experts.

Trump repeatedly has sought to minimize the seriousness of the coronavirus and to shroud risk to the public in ways that experts considered dangerous, and he has spread falsehoods.

On Feb. 10, Trump told thousands of supporters at a campaign rally in Manchester, N.H., that the coronavirus would disappear when the weather gets warmer, and he predicted that by April “it miraculously goes away,” an assertion infectious disease specialists and other scientists dispute.

On Feb. 24, Trump tweeted to his 73 million followers, “The Coronavirus is very much under control in the USA.”

On Feb. 26, Trump claimed that the number of people infected with the coronavirus in the United States was “going very substantially down, not up,” and predicted that “within a couple of days” the total would be “close to zero.”

In the days that followed, Trump repeatedly likened the coronavirus to the common flu, even though the former’s mortality rate is exponentially higher.

On Friday, he turned a visit to the Centers for Disease Control and Prevention in Atlanta into a showcase for his own self-image. During a tour of a facility where doctors and scientists were scrambling to contain the deadly coronavirus, Trump — wearing a red hat emblazoned with his reelection campaign slogan, “Keep America Great” — boasted that he had “a natural ability” to understand science, bragged about his “super-genius uncle” and suggested he would have thrived had he entered medicine instead of politics.

Trump also second-guessed the medical professionals accompanying him on the tour and offered false hope to the public about the availability of test kits.

Trump has been stewing over the brutal critique of his crisis management. On Monday, he tweeted that the media were trying “to inflame the CoronaVirus situation, far beyond what the facts would warrant.”

On Tuesday, Trump said during a visit to the Capitol: “Be calm. It’s really working out. And a lot of good things are going to happen.”

By Wednesday, however, there were more than 125,000 confirmed cases worldwide, with more than 4,600 deaths.

At a White House meeting Wednesday with bank chief executives, CNN correspondent Jim Acosta asked the president, “What do you say to Americans who are concerned that you’re not taking this seriously enough and that some of your statements don’t match what your health experts are saying?”

Trump refused to take the question seriously.

“That’s CNN,” the president said. “Fake news.”