WASHINGTON (AP) — The government reopened its doors Thursday after a battle-weary Congress approved a bipartisan measure to end a 16-day partial shutdown and avert the possibility of an economy-jarring default on U.S. obligations.

Early Thursday, President Barack Obama signed the measure, which the House and Senate passed late Wednesday, ending a brawl with Republicans who tried to use the must-pass legislation to mount a last-ditch effort to derail the president’s landmark health care law and demand concessions on the budget.

The White House directed all agencies to reopen promptly and in an orderly fashion. Furloughed federal employees across the country are expected to return to work Thursday.

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.

There were signs early Thursday that the federal government was slowly coming back to life. “We’re back from the (hash)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.

Obama and his Democratic allies on Capitol Hill were the decisive winners 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 Senate approved the legislation by an 81-18 vote; the House followed suit by a tally of 285-144, with 87 Republicans in favor and 144 against, breaking an informal rule in which a majority of the majority party is supposed to carry legislation. Democrats unanimously supported the bill, even though it locks in funding at levels required by across-the-board spending cuts known as sequestration.

The legislation would fund the government through Jan. 15 and permit it to borrow normally through Feb. 7, though Treasury Secretary Jacob Lew retains the capacity to employ accounting maneuvers to create wiggle room on the debt limit into mid-March or so.

The shutdown sent GOP approval ratings numbers reeling in public opinion polls and exasperated veteran lawmakers who saw it and the possibility of default as folly.

“After two long weeks, it is time to end this government shutdown. It’s time to take the threat of default off the table,” House Appropriations Committee Chairman Harold Rogers, R-Ky., said before the vote. “It’s time to restore some sanity to this place.”

Most House Republicans opposed the compromise bill for failing to do anything about deficits and debt.

“All this does is delay this fight four months,” Rep. Mo Brooks, R-Ala., said. “We need to get to the underlying cause of the problem, which is our out-of-control spending and deficits, and fix it before it’s too late and we go down the toilet to bankruptcy because that’s where America is headed.”

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.