President Trump declared a national emergency to confront the spread of the coronavirus Friday as his administration reached an agreement with House Democrats on a bipartisan economic relief package for Americans affected by the global pandemic.

Trump made the emergency announcement during a news conference in the Rose Garden in which he repeatedly praised his handling of the crisis, denied responsibility for his administration’s missteps and said for the first time that he would likely undergo testing for the coronavirus after coming into contact with an infected man.

“The action I am taking will open up access to up to $50 billion of very important and a large amount of money for states and territories and localities,” he said, adding that he had reached a new partnership with private companies to “vastly increase and accelerate our capacity to test for the coronavirus.”

But in the hours after Trump concluded his remarks, questions began to be raised about the new programs he described and what he was looking for out of Congress.

Trump panned House Democrats’ effort to write a relief bill during the news conference, saying they were “not doing what’s right for the country.” But hours later, Speaker Nancy Pelosi (D-Calif.) announced agreement on the relief package with the administration similar to what had already been outlined by House leaders. The bill would spend tens of billions of dollars on sick leave, unemployment insurance, food stamps and other measures to address the unfolding crisis.

Then after some additional uncertainty over the fate of the bill, Trump tweeted his support. It passed early Saturday on an overwhelmingly bipartisan vote, and the Senate is expected to clear it for the president’s signature early next week.

Trump also announced a new website during his news conference that would allow people to determine whether they need to be tested for the coronavirus.

“Google is helping to develop a website, it is going to be very quickly done unlike websites of the past, to determine whether a test is warranted and to facilitate testing at a nearby convenient location,” he said.

The site will be built by Verily, the life sciences division of Google parent company Alphabet that focuses on research and development around health issues. The company quickly tamped down expectations for how quickly it will be ready, saying in a statement that the website was in “the early stages of development” and that it is “planning to roll testing out in the Bay Area, with the hope of expanding more broadly over time.”

There were also questions about how quickly the drive-through testing sites at major retailers and drugstore chains that Trump and his aides announced Friday would be ready.

The virus outbreak has proved to be one of the most challenging episodes of Trump’s presidency, which has been defined by controversies and his chaotic management style. But despite the criticism directed at Trump’s response to the pandemic, he struck a celebratory tone at the news conference as he praised his decision-making and portrayed the public health emergency as not that bad for the country so far while noting the death toll will likely rise.

“We are doing a great job and we have 40 people right now, 40, compare that with other countries that have many, many times that amount,” Trump said, apparently referring to deaths in the United States from the virus. As of Friday night, that number had risen to 48.

Trump began speaking before the financial markets closed Friday, the end of a volatile and disastrous week that largely erased stock market gains that Trump has regularly touted as proof of his good stewardship. His remarks appeared to buoy investors as the Dow Jones industrial average rose by more than 9 percent Friday, recouping most of the steep losses from the previous day that came in response to Trump’s bungled prime-time address to the nation Wednesday.

The administration has been taking increasingly aggressive steps to contain the outbreak after criticism that not enough is being done to address the public health threat facing the country.

His decision to close off much air travel from Europe days before the World Health Organization labeled Europe the new center of the pandemic was “through luck or through talent, call it whatever you want,” Trump said.

He predicted that while up to 5 million additional tests are in the pipeline, the United States won’t need nearly that many.

“We want to make sure that those who need a test can get a test very safely, quickly and conveniently, but we don’t want people to take a test if we feel that they shouldn’t be doing it and we don’t want everyone running out and taking — only if you have certain symptoms,” he said.

Trump created confusion over his own testing status. He at first said his doctors told him he did not need to be tested despite coming into contact with a Brazilian official last weekend who contracted the virus. Then, when pressed on why he shouldn’t when public health officials have advised that people under similar circumstances be tested, Trump said he would “most likely” get one but not because he was concerned about anyone he has interacted with. “Not for that reason but because I think I will do it anyway,” Trump said. “Fairly soon, we’re working out a schedule.”

Late Friday, the White House issued a memo from Trump’s White House physician, Navy Cmdr. Sean P. Conley, that said the president does not need to be either tested or quarantined.

Conley’s memo acknowledged the second positive test among people included in a dinner Trump attended at his Florida resort last weekend.

“The president’s exposure to the first individual was extremely limited (photograph, handshake), and though he spent more time in closer proximity to the second case, all interactions occurred before any symptom onset,” the memo read.

Numerous other U.S. government officials have repeatedly warned Americans that the virus can be transmitted before patients have symptoms. Even limited contact, such as standing next to an infected person as Trump and Vice President Pence did in Florida, can lead to infection.

“These interactions would be categorized as LOW risk for transmission per CDC guidelines, and as such, there is no indication for home quarantine at this time,” Conley’s memo said.

The memo went on to say that since Trump “remains without symptoms, testing for COVID-19 is not currently indicated.”

It was not clear early Saturday whether than meant that Trump had decided not to be tested after all.

The emergency declaration was the most far-reaching federal action to date to respond to the fast-spreading outbreak of disease that has not yet reached its peak in the United States. The coronavirus has sickened more than 144,000 worldwide and had killed nearly 5,400 by Friday. The number of infections is likely much higher.

The emergency declaration allows the administration to provide emergency funding to state and local governments and gives the Federal Emergency Management Agency responsibility for coordinating disaster relief. Trump said his action would also give the Health and Human Services secretary authority to waive several regulations and limitations in order “to deliver our people the care that they need.”

Earlier this week, Trump announced restrictions on flights from Europe, a move public health experts said was less useful than taking major steps to combat the spread of the virus within American communities.

After facing heated, bipartisan criticism, the Trump administration announced a series of steps to boost the availability of tests and said it would partner with the private sector to set up drive-through testing sites.

The move was a tacit acknowledgment by Trump that his week-old assertion that tests were available to anyone who wanted them had yet to become a reality. That claim has been belied by criticism from lawmakers and frustrated Americans unable to find out whether they are infected.

Government officials and executives of big-box stores, drugstores and other businesses described an assembly-line approach to test people in their cars and report back results in 24 hours. They said the effort could start as soon as Sunday.

The drive-through tests would be administered by state health workers and the members of the U.S. Public Health Service, according to three individuals familiar with the plans. But several key participants said the administration was overstating the plan, including its scope, timetableand other aspects.

Trump was reluctant to take ownership of the problems that have led to a lack of available tests and confusion about who is eligible to use the limited supply at hand.

“I don’t take responsibility at all,” Trump said, blaming his predecessors and saying he knew nothing about his administration’s 2018 decision to disband a team of experts who had focused on preparing for global pandemics.

The bipartisan relief package is expected to amount to several tens of billions of dollars in aid for workers, state governments and low-income and uninsured people.

Declaring a national emergency can be helpful for marshaling resources, and some experts and groups, including the American Hospital Association, called for it to be done earlier. It’s important to stress that these declarations are administrative and provide flexibility in accessing resources and spending money, experts said. They are not done to signify that the country is in imminent danger.

A forecast this week from Tom Frieden, the former director of the Centers for Disease Control and Prevention, developed with colleagues at the nonprofit organization Resolve to Save Lives, offered a wide range of outcomes, depending on how many people get infected and how deadly the disease is. As few as 327 and as many as 1.635 million people could die of the disease, perhaps over the next two to three years, Frieden and his colleagues estimated.

The relief package, which Pelosi negotiated with Treasury Secretary Steven Mnuchin, includes several Democratic priorities, including measures to boost paid family leave and unemployment insurance, ensure free coronavirus testing and strengthen nutritional aid such as food stamps.

The legislation does not include a payroll-tax cut, one of the key priorities Trump has called for as a way to boost worker pay ahead of his reelection bid.

“If you want to get money into the hands of people quickly & efficiently, let them have the full money that they earned, APPROVE A PAYROLL TAX CUT until the end of the year, December 31,” Trump wrote Friday morning on Twitter. “Then you are doing something that is really meaningful. Only that will make a big difference!”

The legislation also did not include any targeted proposals to support some of the key industries affected by the virus, including airlines and cruise lines — despite Trump’s promises to help them.

Mnuchin said the agreement marked just the beginning of what is likely to be a multistage economic relief program that combines legislation with the use of Trump’s executive authority. The goal is to stave off or reduce the chances of a recession, which some financial analysts are predicting could hit in the months ahead of the election.

“I can assure you we will use whatever tools we need to make sure that the industries that are impacted by this get through this,” Mnuchin said Friday in an interview on CNBC.

On Friday, Trump announced that he was temporarily waiving interest on all federal student loans. He also said the government would be buying large amounts of oil for the Strategic Petroleum Reserve.

Concerns about the coronavirus pandemic rippled across the globe Friday, as schools closed to millions of students; Paris’s famed Louvre Museum closed indefinitely and more large events were canceled, and the Group of Seven leaders planned a virtual crisis conference call for Monday.

Trump’s remarks came as the World Health Organization warned that Europe “has now become the epicenter” of the pandemic, and as more European Union nations took action — shutting down schools, implementing travel restrictions and passing other emergency measures.

While the outbreaks have been worse in Asia and Europe, public health officials warn it will get worse in the United States before it gets better, even as they urge the public to remain calm.

“There will be many more cases, but we’ll take care of that, said Anthony S. Fauci, director of the National Institute of Allergy and Infectious Diseases and a member of the president’s coronavirus task force. “And ultimately, as the president said, this will end.”

Lena H. Sun, Mike DeBonis, Erica Werner and Jeff Stein contributed to this report.