Senate leaders and the White House came to an agreement in principle on a nearly $2 trillion stimulus package in the early hours of Wednesday morning—an unprecedented spending bill aimed at shoring up large swaths of the American economy as the country deals with the fallout from the coronavirus pandemic. “At last, we have a deal,” Majority Leader Mitch McConnell announced on the Senate floor around 1:30 a.m. “In effect, this is a wartime level of investment into our nation.” The final wording of the bill is still being hammered out, but the text is expected to be ready later Wednesday morning with a vote in the Senate in the afternoon. “This is not a moment of celebration, but one of necessity,” Minority Leader Chuck Schumer said of the deal. “To all Americans I say, ‘Help is on the way.’ ”

After five days of increasingly acrimonious negotiations, lawmakers compromised on a number of provisions that would see thousands of dollars in direct payments to low- and middle-income individuals, sweeping unemployment protections in the form of months of payments for workers that have been laid off or had their hours cut back, loans (that are converted to grants under certain conditions) to small businesses to keep them afloat and incentivize them to avoid laying off workers, as well as $500 billion in funds for financial assistance to businesses and states. The scope of the bill is enormous, touching every part of the American economy. It is nearly three times larger than the $700 billion Troubled Asset Relief Program passed in the aftermath of the 2008 financial crisis. It also amounts to “several hundreds of billions of dollars more than the entire United States federal budget for a year,” the New York Times notes, “and administration officials said they hoped that its effect on a battered economy would be exponentially greater, as much as $4 trillion.”

For everyday Americans, the deal would provide $1,200 in direct payments for workers with incomes up to $75,000 per year—the vast majority of the American workforce—as well as an additional $500 per child. The payments would be phased out at higher income levels and capped at $99,000 such that Americans earning six figures would not get a payment. In addition, Democrats pushed for and secured expanded unemployment insurance that would provide laid off workers $600 a week for four months.

One of the sticking points in the negotiation was the lack of oversight for the $500 billion fund that allowed the Treasury to disperse the money at its discretion to bail out industries without any checks on how it was being spent. The final version of the bill includes a mechanism for congressional oversight. Schumer also told Democrats that the bill includes specific provisions disallowing Trump’s family businesses from receiving a bailout. Republicans had blamed Democrats for the delay in agreeing to the legislation, but, the Washington Post reports, Republicans were also taking their time. “Senate Republicans were being extra meticulous because they felt an earlier and much smaller coronavirus relief bill, which [Treasury Secretary Steven] Mnuchin negotiated in a rush with [Speaker Nancy] Pelosi this month, turned out to have provisions related to paid sick leave that GOP senators opposed—but which they reluctantly accepted,” according to the Post. “Now, they wanted to double- and triple-check Mnuchin’s work in brokering a deal with Schumer, given the enormous stakes.”

The bill is expected to pass through the Senate as early as Wednesday afternoon, but will then need to be voted on in the House, which is currently not in session. Some of its members are in quarantine or at home in their districts, making the health and legislative logistics of advancing the deal tricky. One possible solution is ratifying the deal by unanimous consent, a tactic usually reserved for uncontroversial measures before the House. House members, however, might balk at rubber-stamping a bill of such importance, in which case lawmakers would have to return to the capital for a socially distanced vote.