WASHINGTON (NBC News) -- On Capitol Hill Wednesday night, the House followed the Senate's lead and approved a deal to raise the debt ceiling and reopen government.
President Obama said he will sign the agreement that is almost exactly what he's been demanding for months.
This looks like a major retreat for republicans, who backed down after getting battered in public opinion polls.
It's a win for the president, who refused to compromise on Obamacare.
"I want to thank the leadership for coming together this done, but hopefully next time it won't be in the 11th hour," said President Obama.
The plan would reopen government through January 15th, with back pay for furloughed federal workers, and raise the debt ceiling through February 7th.
The plan easily passed the Senate and the House, where most republicans voted no and the tea party vowed to keep targeting Obamacare.
Moderate republicans vow to prevent another debt crisis.
But freshman Tea Party Senator Ted Cruz loves the Obamacare fight and the spotlight.
"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," said Senator Cruz.
After 16 days, all of government will be open and debts will get paid, but the partisan fight will go on.
-- Steve Handelsman, NBC News reports