Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — The House of Representatives passed a coronavirus aid package in a bipartisan vote early Saturday, after Democrats and the Trump administration reached a deal that includes free testing, paid emergency leave and other resources intended to help stem the crisis and stabilize financial markets.

The vote, which concluded after 12:30 a.m., was 363-40-1. That sets up a Senate vote that could happen early next week.

President Donald Trump had tweeted that Democrats and Republicans should vote yes on the measure, and that he was looking forward to signing it.

“We are proud to have reached an agreement with the Administration to resolve outstanding challenges, and now will soon pass the Families First Coronavirus Response Act," House Speaker Nancy Pelosi Friday.

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

The deal was struck after numerous conversations over the last two days between Pelosi and Treasury Secretary Steven Mnuchin. They spoke 20 times Friday.

Trump green-lighted the measure and later tweeted his approval of the deal.

I fully support H.R. 6201: Families First CoronaVirus Response Act, which will be voted on in the House this evening. This Bill will follow my direction for free CoronaVirus tests, and paid sick leave for our impacted American workers. I have directed.... — Donald J. Trump (@realDonaldTrump) March 14, 2020

Mnuchin confirmed the deal in an interview with Fox Business. “We have an agreement that reflects what the president talked about in his speech the other night,” he said, referring to Trump's assurances that a deal would include help with sick leave and paid medical leave.

In a letter to her colleagues about the deal, Pelosi said, "This legislation is about testing, testing, testing."

Download the NBC News app for full coverage of the coronavirus outbreak

Pelosi said that the legislation would facilitate free coronavirus testing, including for the uninsured. The measure also includes two weeks of paid sick leave and paid family and medical leave. To assist people who lose their jobs amid the outbreak, Pelosi said the bill strengthens unemployment insurance and boosts food security initiatives like food stamps.

It also increases federal funds "for Medicaid to support our local, state, tribal and territorial governments and health systems, so that they have the resources necessary to combat this crisis," she said.

The speaker said at a pre-vote news conference Friday night that Democrats could have passed a bill Thursday, “but we thought that it would be important to show the American people – to assure the American people that we are willing and able to work together to get a job done for them.”

Senate Majority Leader Mitch McConnell, R-Kentucky, in a statement after the House vote suggested that it has support in the Senate.

“Of course, Senators will need to carefully review the version just passed by the House. But I believe the vast majority of Senators in both parties will agree we should act swiftly to secure relief for American workers, families, and small businesses,” McConnell said.