Senate leaders and the White House have reached a deal on a $2 trillion stimulus package, which includes a large increase in unemployment insurance and hundreds of billions of dollars to aid companies harmed by the coronavirus pandemic.

Shortly before 2 a.m. on Wednesday morning, Senate Majority Leader Mitch McConnell announced on the Senate floor that an agreement had been reached after five days of negotiations. He said the bill would be voted on later in the day.

“At last we have a deal,” he said. “Help is on the way.”

Charles Schumer, the Senate minority leader, said the agreement would include $150 billion in aid to state and local governments, in addition to support for hospitals, corporations, and unemployed workers.

“We believe the legislation has been improved significantly, to warrant quick consideration and passage,” he said.

The bill expands unemployment insurance to cover freelancers and gig workers, a provision of interest to the entertainment industry, where work is typically temporary. The bill also boosts unemployment checks by $600 per week for a period of four months, according to details that had been released earlier. The deal also provides $1,200 to most American adults, plus $500 per child.

The package also includes loans and loan guarantees for small and large businesses. The National Association of Theatre Owners (NATO), has urged Congress to pass the bill, arguing that theaters are at risk of going bankrupt without help.

“This structure is a good structure,” said economist Douglas Holtz-Eakin, the president of the American Action Forum. “You’re putting money in at the point where it matters. It keeps the business alive. It keeps the workers getting paid. It does it for as long as it needs to.”

Democrats had twice rejected Senate Republicans’ earlier version of the bill, arguing that the $500 million bailout fund lacked proper oversight. The new version has an inspector general and an oversight board. The Senate leaders had earlier said that a deal was close.

“This is a national crisis,” McConnell said on the floor earlier. “The clock has run out. The buzzer is sounding. The hour for bargaining as though this were business as usual has expired.”

In a town hall on Fox News on Tuesday, President Donald Trump said it was important to bail out companies that had been ordered to shut down.

“I want to protect our workers — workers first,” Trump said. “But you have to protect companies like Boeing… They were in trouble and then this happened. We can’t lose a Boeing, and we can’t lose some of these companies.”