President Barack Obama is now waiting on a bill to arrive on his desk, that will allow the government to reopen.
After a 3 week shutdown, the House and Senate finally agreed to a plan to get the country moving again.
It's a win for President Obama, who refused to compromise on Obamacare.
"I want to thank the leadership for coming together this done, but hopefully next time it wont be in the 11th hour," Obama said.
The next time is in just three months.
The plan would reopen government though January 15th with back pay for furloughed federal workers and raise the debt ceiling through February 7th, but America came close to default.
Senator Harry Reid said, "This was pain inflicted on a nation for no good reason"
The plan easily passed the Senate and the House, where most Republicans voted no and the Tea Party vowed to keep targeting Obamacare.
Representative Phil Gingrey said, "We indeed will continue to fight. We're not going anywhere!"
Moderate Republicans vow to prevent another debt crisis.
Representative Peter King said, "By early on targeting the one guy who caused it all, Ted Cruz!"
But some say the Freshman Tea Party Texas Senator loves the Obamacare fight and the spotlight.
Senator Ted Cruz said, "I am today encouraged by millions of Americans who want to get back to the constitution and stop this train wreck of a law hurting Americans"
After 16 days, all of government will be open and debts will get paid, but the partisan fight will go on.
Facing a Tea Party primary challenge, Senate Republican leader Mitch McConnell tacked onto Wednesday night's deal a $3 billion pet project for his homestate of Kentucky.
This is a move that Republican John McCain called disgusting.