The Republicans, who had engaged in a bitter budget battle to derail Obama's healthcare law nicknamed Obamacare conceded defeat as the Oct 17 debt ceiling deadline approached when the Treasury had warned US would run out of cash to pay its bills.
The eleventh hour deal with only minor concessions from Democrats hammered out earlier by Democratic Senate Majority Leader Harry Reid his Republican counterpart Mitch McConnell received broad bipartisan support in both chambers.
The vote was 81-18 in the Democratic led Senate with only 18 of the 45 Republicans opposing it and 285- 144 in the Republican controlled House. As many as 87 Republicans joined all 198 Democrats in supporting the measure.
Shortly after the Senate vote Wednesday night, Obama said once the House passes the deal, "I will sign it immediately. We'll begin reopening our government immediately."
"There's a lot of work ahead of us, including our need to earn back the trust of the American people that's been lost over the last few weeks," he said. "And we can begin to do that by addressing the real issues that they care about."
As the bill headed for the President's desk, the White House asked federal workers to be ready to return to work Thursday morning.
"Now that the bill has passed the United States Senate and the House of Representatives, the President plans to sign it tonight and employees should expect to return to work in the morning," director of the office of management and budget, Sylvia Mathews Burwell, said.
The deal funds the government through Jan 15, raises the debt limit until Feb 7 and includes a provision in the deal that strengthens verification measures for people getting subsidies under Obamacare, the only concession that the Republicans were able to wrest.
It also sets a mid December deadline for completing budget negotiations between the House and the Senate for a long-term spending plan.
Democrat Senate Budget Committee Chairwoman Patty Murray and House Republican Budget Committee Chairman Paul Ryan plan to have a breakfast meeting Thursday to start the ball rolling on budget negotiations.
The deal also gives the Treasury Department the ability to borrow beyond the debt ceiling.
"Because of today's efforts, we will continue to honour all of our commitments - a core American value - and preserve the full faith and credit of the United States," Treasury Secretary Jack Lew said in a statement Wednesday night.
Welcoming the "important and necessary step" taken by the US Congress, IMF Managing Director Christine Lagarde said: "Looking forward, it will be essential to reduce uncertainty surrounding the conduct of fiscal policy by raising the debt limit in a more durable manner.
"We also continue to encourage the US to approve a budget for 2014 and replace the sequester with gradually phased-in measures that would not harm the recovery, and to adopt a balanced and comprehensive medium-term fiscal plan," she said.