Want the best of VICE New straight to your inbox? Sign up here.

WASHINGTON — The Senate announced a hard-won deal on a massive stimulus package aimed at saving the American economy from melting down over the coronavirus pandemic.

The $2 trillion bill would unleash the single biggest tsunami of emergency rescue funds in modern American history, providing hundreds of billions in loans to hard-hit industries and sending thousand-dollar checks straight to individual Americans. The bill includes what Democrats call “unemployment insurance on steroids” and emergency funding for states and hospitals.

The deal between the Senate and the Trump administration was finally announced at 1:30 am local time on Wednesday morning, after five straight days of negotiations.

“At last we have a deal,” Senate Majority Leader Mitch McConnell said. “After days of intense discussion, the Senate has reached a bipartisan agreement on a historic relief package for this pandemic. I’m thrilled that we’re finally going to deliver for the country that has been waiting for us to step up.”

The bill aims to kickstart the American economy by sending many Americans $1,200 checks, creating a $367 billion loan program for small businesses and launching a $500 billion fund for industries.

McConnell said the Senate would pass the legislation on Wednesday, but with the House not in session, getting it approved there could take longer.

The agreement follows days of bitter partisan feuding over how to mount an economic response to the lethal pandemic that’s profoundly disrupted American life. Republican Senators, who rolled out the original plan last week, argued Democrats were putting the nation at risk by holding up the bill while fighting for stronger protections for workers and tougher conditions on businesses who seek crisis loans. Democrats argued the original proposal was unacceptably tilted in favor of corporations at the expense of workers, and didn’t do enough for states and hospitals.

Democrats said they managed to win some of the key changes, including heightened scrutiny over the Trump administration as it hands out emergency loans to troubled companies.

Republicans had wanted to give Trump’s Treasury Secretary Steven Mnuchin sweeping authority to dispense half a trillion dollars in loans to private businesses — without having to explain to outsiders what he was doing or who was getting the money — for six months.

Democrats fumed that such a $500 billion “slush fund,” tightly and secretly controlled by the president and his top aides, could be easily abused, or awarded to GOP political donors with almost no outside accountability. Trump, whose hotel empire has been threatened with the entire hospitality industry, explicitly refused to promise not to award himself juicy government loans from the fund on Sunday.

Democrats said that they succeeded in adding language to the bill that increases accountability, including both an inspector general and a new Congressional panel to monitor the loans. The constraints are similar to the ones placed on the Wall Street bailout from the 2008 financial meltdown.

The bill explicitly bans businesses controlled by Trump, Vice President Mike Pence, or cabinet members from taking loans from the fund, Democrats said.

Companies that receive a crisis loan will be barred from buying back their own stock for a year longer than the duration of the loan. Corporate stock buybacks are a method companies use to increase the value of their own stock by reducing the available supply of shares on the market, but they’ve been criticized by the left for benefiting shareholders over workers.

The Treasury Department will now have to actually disclose who’s getting the loans in real time, instead of waiting six months as originally proposed by Republicans last week.

The bill also includes significant unemployment insurance upgrades, extending benefits to four months from three months and raising the maximum payout by $600 per week. The measure aims to ensure that laid-off workers, on average, receive their full pay for a period of four months, Senate Minority Leader Chuck Schumer said.

The stock market rallied on optimism about the plan Tuesday, with the Dow Jones Industrial Average gaining 11% in the biggest daily increase since the depths of the Great Depression in 1933.