Temporary truce sets up another collision between Obama and Republicans over spending and borrowing early next year.

Receive the latest politics updates in your inbox

President Barack Obama has signed a bill ending the 16-day partial government shutdown and raising the nation's debt limit after Congress passed a last-minute bipartisan deal more than two weeks after the government shutdown began and just hours before the U.S could have begun to default on its debts.

President Barack Obama signed a bill early Thursday ending the 16-day partial government shutdown and raising the nation's debt limit after Congress passed a last-minute bipartisan deal just hours before the U.S could have begun to default on its debts.

The passage of the bill now paves the way for the federal government to reopen. The Office of Management and Budget ordered that federal workers plan to return to work Thursday and federal departments and agencies resume operations "in a prompt and orderly manner."

The impasse had shuttered national parks and monuments, and mostly closed down NASA, the Environmental Protection Agency and the Interior Department. Critical functions of government went on as usual and most federal employees won't see their paychecks delayed, but the closure and potential default weighed on the economy and spooked the financial markets.

The 1st Government Shutdown in 17 Years

There were signs early Thursday that the federal government was slowly coming back to life. "We're back from the #shutdown!" the Smithsonian Institution crowed on Twitter, announcing that museums would reopen Thursday and the National Zoo in Washington on Friday.

Standard & Poor's estimated the shutdown has taken $24 billion out of the economy, and the Fitch credit rating agency warned Tuesday that it was reviewing its AAA rating on U.S. government debt for a possible downgrade.

President Barack Obama thanked the Senate and its leadership from both parties in brief remarks at the White House before the House passed the bill. "We’ve got to get out of the habit of governing by crisis," he said.

Government Shutdown's Unexpected Effects

The House then voted 285-144 to pass the Senate's budget and debt ceiling deal, succeeding with the support of Democrats and some Republicans.

Obama and his Democratic allies on Capitol Hill prevailed in the fight, which was sparked by tea party Republicans like Sen. Ted Cruz of Texas, who prevailed upon skeptical GOP leaders to use a normally routine short-term funding bill to "defund" the 2010 health care law known as Obamacare.

"We fought the good fight. We just didn't win," House Speaker John Boehner, R-Ohio, conceded in a radio interview. He was given positive reviews from Republicans for his handling of the crisis, though it again exposed the tenuous grasp he holds over the fractious House GOP conference.

The agreement was brokered by the Senate's top Democrat, Majority Leader Harry Reid of Nevada, and its Republican leader, Mitch McConnell of Kentucky. They stepped in after the House was unable to coalesce around a Republican-only approach Tuesday.

McConnell is up for re-election next year, and his tea party primary opponent issued a statement blasting his role.

"When the stakes are highest, Mitch McConnell can always be counted on to sell out conservatives," Matt Bevin said. In the House, conservatives praised Boehner for tenacity.

The bill had passed the Senate with broad bipartisan support by a vote of 81 to 18, just a day shy of the deadline to raise the debt limit. It would fund the government through Jan. 15, extend the debt limit through Feb. 7 and have lawmakers work toward agreement on an overarching budget by mid-December.

The bill's passage was only a temporary truce that sets up another collision between Obama and Republicans over spending and borrowing early next year. It's the second time this year that Congress has passed legislation to increase the government's borrowing cap with few if any conditions on the president, reversing a 2011 precedent in which the threat of default was used to extract $2.1 trillion in spending cuts from a politically wounded Obama.

"With the shutdown behind us," Obama said after the Senate vote, "we now have an opportunity to focus on a sensible budget that is responsible, that is fair and that helps hardworking people all across this country."

At the same time, House-Senate talks will begin on a broader budget pact in hopes of curbing deficits and easing across-the-board budget cuts that have slammed the Pentagon and domestic agencies alike. Such agreements have proven elusive in the current era of divided government.

"No one thinks this will be easy" Senate Budget Committee Chairman Patty Murray, D-Wash., said of budget negotiations. Murray and House Budget Committee Chairman Paul Ryan, R-Wis., along with their ranking minority members, immediately scheduled a breakfast meeting for Thursday to break the ice.