It didn’t quite come down to the 11th hour, but with just over an hour until a midnight deadline, Congressional Democrats and Republicans on April 8 agreed on a budget deal which would keep the federal government open for business.

According to multiple news sources, lawmakers reached an agreement just before 11 p.m. Friday night to create a five-day stopgap funding bill, with a longer-term budget deal to be worked out and voted on during the week of April 11.

The funding extension will cut spending by $2 billion, and Congressional leaders said the framework was in place for a long-term deal that would cut $38.5 billion in spending through Sept. 30, the end of the current fiscal year.

The Democrats wanted $33 billion in budget cuts while the Republicans wanted to slash $61 billion in spending, a proposal that they later reduced to $40 billion. .

“The government will be open for business,” President Obama said. “In the final hours before our government would have been forced to shut down, leaders in both parties reached an agreement that will allow our small businesses to get the loans they need, our families to get the mortgages they applied for, and hundreds of thousands of Americans to show up at work and take home their paychecks on time.”

The agreement capped a week of fast-paced, high-stakes dealing which threatened to close down the federal government for the first time in 15 years when a similar budget put more than 800,000 government employees and numerous private-sector contractors temporarily out of work.

“This has been a lot of discussion and a long fight,” House Speaker John Boehner (R-Ohio) said, according to CNN, while Senate Majority Leader Harry Reid (D-Nev.) called the deal “difficult but important for the country.”

Democrats turned aside a Republican push to strip more than $300 million in federal funding from Planned Parenthood and other groups that provide abortions, according to The New York Times, and also blocked GOP efforts to curb the Environmental Protection Agency’s regulation of greenhouse gasses.

In exchange, Republicans earned a larger cut in overall government spending than Democrats had initially sought.