WASHINGTON — President Trump declared a national emergency on Friday over the coronavirus pandemic and announced steps he said would speed the availability of testing, and early Saturday, the House passed a bill reflecting a deal with his administration to provide billions of dollars to help sick workers and to prop up a slumping economy.

Markets rallied on Mr. Trump’s emergency declaration, which he said would free up $50 billion for states and localities to cope with the outbreak — separate from the congressional relief measure — and which would allow the Treasury Department to delay tax filing deadlines for some individuals and businesses.

During a news conference in the Rose Garden, the president also said he would indefinitely suspend interest collections on federal student loans, although no bills would go down. And he instructed the Energy Department to buy enough oil to fill the nation’s Strategic Petroleum Reserve “to the top.”

The S&P 500 soared during the remarks and closed the day up by more than 9 percent.

At the news conference, Mr. Trump followed none of the safety protocols recommended to combat the spread of the virus, shaking hands with multiple administration officials and chief executives and sharing a microphone with them.