Here are the key moments from the last day before the financial default deadline, when the Senate and House came together to pass a deal to reopen the government. (The Washington Post)

Federal agencies, parks, museums and monuments began to reopen Thursday morning, after a chastened Congress ended a bitter funding standoff that triggered a 16-day government closure and drove the nation toward the brink of default.

The agreement struck by Senate Majority Leader Harry M. Reid (D-Nev.) and Minority Leader Mitch McConnell (R-Ky.) funds agencies through mid-January, calls hundreds of thousands of civil servants back to work and raises the $16.7 trillion debt limit.

“There are no winners here,” President Obama said at the White House late Thursday morning. “These last few weeks have inflicted completely unnecessary damage on our economy.”

[Read the latest updates.]

Obama called on Congress to resist “pressure from the extremes” and “understand that how business is done in this town has to change.” He urged lawmakers to pursue a “balanced approach to a responsible budget” and to pass comprehensive immigration reform and a new farm bill.

And he offered thanks and encouragement to federal workers as they returned to their jobs. “What you do is important, and don’t let anybody else tell you different,” he said.

Top officials in his administration conveyed the same message.

“Good morning folks, thank you for your service,” called out Agriculture Secretary Tom Vilsack, as no-longer-furloughed civil servants streamed from the nearby Smithsonian Metro station through the doors of agency headquarters.

Vice President Biden greeted employees at the Environmental Protection Agency, and White House Chief of Staff Denis McDonough shook hands with returning workers at the guarded gate outside 1600 Pennsylvania Avenue NW.

At the National Zoo, officials turned the popular panda cam back on, revealing an older, fatter and more robust black and white cub than was last seen more than two weeks earlier. The cub, now nearly two months old, gained two pounds during the shutdown, the zoo announced Thursday.

The Department of Veteran Affairs said it would issue benefit payments to about 5 million veterans, survivors and their families on Nov. 1 as scheduled now that funding has been restored. The VA had warned that if the shutdown continued to the end of the month, it would run out of funds and be unable to issue checks, a disclosure that caused major consternation among lawmakers and veterans.

The bill passed late Wednesday ended a stalemate created last month, when hard-line conservatives pushed Republican leaders to use the threat of shutdown to block a landmark expansion of federally funded health coverage.

That campaign, however, succeeded mainly in undermining popular support for the Republican Party. By the end, dozens of anxious GOP lawmakers were ready to give Obama almost exactly what he requested months ago: a bill to fund the government and increase the Treasury Department’s borrowing power with no strings attached.

The Senate overwhelmingly ratified the deal Wednesday evening, 81 to 18, with more than half of Senate Republicans voting yes. A few hours later, the House followed suit, approving the measure 285 to 144. Eighty-seven Republicans joined a united Democratic caucus in approving the measure, allowing Congress to meet a critical Treasury Department deadline with one day to spare.

[Related: How Congress voted]

Obama signed the measure into law shortly after midnight,reopening parks and monuments across the nation, restoring government services and putting furloughed federal employees back on the job, many of them in the Washington region.

In his remarks Thursday morning, Obama said the shutdown and the threat of a U.S. default probably slowed economic growth, set back hiring and increased borrowing costs, adding to deficit that has been shrinking.

“That’s not a surprise that the American people are completely fed up with Washington,” Obama said. “At a moment when our economic recovery demands more jobs, more momentum, we’ve got yet another self-inflicted crisis that set our economy back. And for what? There was no economic rationale for all of this.”

He added: “Probably nothing has done more damage to America’s credibility in the world, our standing with other countries, than the spectacle that we’ve seen these past several weeks. It’s encouraged our enemies, it’s emboldened our competitors, and it’s depressed our friends, who look to us for steady leadership.”

Obama predicted that “we’ll bounce back from this,” but he cautioned that it “won’t be easy.” He said, “There’s a lot of noise out there, and the pressure from the extremes affect how lot of members of Congress see the day-to-day work that’s supposed to be done here.”

“So let’s work together to make government work better instead of treating it like an enemy or purposely making it work worse,” Obama said. “Don’t break what our predecessors spent over two centuries building.”

He said he had a simple message “for all the dedicated and patriotic federal workers” who were furloughed or worked without pay during the shutdown: “Thank you. Thanks for your service. Welcome back. What you do is important. It matters. You defend our country overseas. You deliver benefits to our troops, who have earned them, when they come home. You guard our borders. You protect our civil rights. You help businesses grow and gain footholds in overseas markets. You protect the air we breathe and the water our children drink, and you push the boundaries of science and space, and you guide hundreds of thousands of people each day through the glories of this country.”

But Sen. Ted Cruz (R-Tex.), a leading opponent of Obama’s health-care law, declined to rule out another shutdown over the issue. “I will continue to do anything to stop the train wreck that is Obamacare,” Cruz told ABC News on Thursday. Pressed on whether he would rule out a second shutdown, he said only that he would “stand with the American people working to stop Obamacare.”

The measure Obama signed into law early Thursday guarantees federal workers back pay for time spent at home, aids flood-ravaged Colorado and provides extra cash for fighting wildfires in the West. And it grants the D.C. government, which relies on Congress to approve its budget, authority to manage its own affairs through the 2014 fiscal year.

Enforcement of the debt limit is suspended until Feb. 7, setting up another confrontation over the national debt sometime in March, independent analysts estimated. Meanwhile, federal agencies are funded through Jan. 15, when they might shut down again unless lawmakers resolve a continuing dispute over deep automatic spending cuts known as the sequester.

“Republicans and Democrats in Congress have come together around an agreement that will reopen our government and remove the threat of default from our economy,” Obama said Wednesday. “We can begin to lift this cloud of uncertainty and unease from our businesses and from the American people.”

Senate Budget Committee Chairman Patty Murray (D-Wash.) met over breakfast Thursday morning with her House counterpart, Rep. Paul Ryan (R-Wis.), to start a new round of talks aimed at averting another crisis. The ranking minority members of each committee, Sen. Jeff Sessions (R-Ala.) and Rep. Chris Van Hollen (D-Md.), also participated in the meeting.

Ryan told reporters that the lawmakers “had a very good conversation” and agreed that their goal was “to do good for the American people, to get this debt under control, to do smart deficit reduction and to do things that we think can grow the economy and get people back to work.”

Murray said the group was determined to address “the challenge that has been handed to us over the coming few short weeks.”

“We believe that there is common ground in showing the American people that as Congress we can work and make sure our economy is growing and that people are back to work and that we can do the job we were sent here to do,” Murray said. “To find common ground between our two budget resolutions and set a path forward for Congress to work on.”

Obama on Wednesday night repeated his vow to work with Republicans to rein in a national debt that remains at historically high levels.

“With the shutdown behind us and budget committees forming, 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,” Obama said at the White House.

Few held out hope that the talks would yield an ambitious plan to overhaul the tax code or restructure federal health and retirement programs, the biggest drivers of future borrowing. But there were signs that Republicans may be more inclined to compromise and less inclined to follow what Rep. Aaron Schock (R-Ill.) called “the fringe elements” of the GOP.

“The reality is there’s a much larger population within our caucus that recognizes reality for what it is,” said Schock, who represents the middle-America town of Peoria. “At the end of the day, whatever we pass will have to be a bipartisan bill. The sooner that our conference recognizes that we’re going to have to negotiate with the other side, the more we can get done.”

The fight over the health-care law that many call Obamacare originated on the Senate side of the Capitol, with Sens. Cruz and Mike Lee (R-Utah), as well as former senator Jim DeMint (R-S.C.), who now heads the conservative Heritage Foundation. Cruz and Lee voted against Wednesday’s agreement, as did GOP presidential hopefuls Sens. Marco Rubio (Fla.) and Rand Paul (Ky.).

However, Boehner and the Republican-controlled House waged the fiercer battle, passing bill after bill to defund, delay and otherwise undercut the Affordable Care Act, only to watch those bills die in the Democratic-controlled Senate.

Cruz rejected the idea that Republicans had won nothing during the six-week fight. While the measure contained just one small adjustment to the health-care law — strengthening safeguards against fraud among recipients of federal health-insurance subsidies — Cruz said the debate succeeded in calling attention to the harm he asserts the law is causing consumers, employers and the U.S. economy.

“We saw the House of Representatives take a courageous stand, listening to the American people,” Cruz said. “Had Senate Republicans united and supported House Republicans, the outcome of this, I believe, would have been very, very different.”

Still, the price the House paid for waging what many Republicans saw as an unwinnable fight was ultimately devastating. Boehner had counseled against shutting down the government as recently as late August, fearing a backlash among voters that quickly materialized in public opinion polls.

Yanked to the right, Boehner tried repeatedly to satisfy Cruz and his allies. He made a last-ditch effort Tuesday to rally his troops around a measure that would have eked out two minor health-care victories: repeal of a tax on medical devices that helps finance the Affordable Care Act and elimination of employer-provided health-insurance subsidies for lawmakers, their aides and administration officials. The subsidies, long available to all federal workers, have been derided by conservative commentators as a “special exemption” now that lawmakers are required to get insurance through the new health-care exchanges.

It wasn’t enough. Conservative lawmakers demanded more concessions. More moderate Republicans complained that the plan would never pass the Senate.

On Tuesday night, with House Republicans bitterly divided and Boehner himself badly weakened, the effort collapsed. By Wednesday, Boehner and McConnell had no choice but to seal a deal with Reid or run the risk of inviting economic calamity.

[Related: The end of Boehner’s speakership?]

In the House, the vote was eerily similar to the last fiscal showdown with Democrats. During the brief debate, not a single member of the GOP leadership team spoke in favor the bill. That left House Appropriations Chairman Harold Rogers (R-Ky.) alone among senior Republicans to publicly champion the bill, just as Ways and Means Chairman Dave Camp (R-Mich.) had been during the “fiscal cliff” vote on New Year’s Day.

It ended with a bizarre moment, when a House stenographer ran to a microphone and began shouting religious messages. She was forcibly removed from the chamber.

In the Senate, McConnell, a wily tactician unaccustomed to surrender, tried to salvage some sense of accomplishment. As he and Reid announced the deal at midday Wednesday on the Senate floor, McConnell noted that the measure would maintain current spending levels, “protecting the government spending reductions that both parties agreed to under the Budget Control Act” of 2011.

“That’s been a top priority for me and my colleagues on the Republican side of the aisle,” McConnell said.

But Democrats quickly said they would seek to roll back those cuts before the next round of sequester reductions goes into effect Jan. 15. Meanwhile, many Republicans lamented that the misguided attack on the health-care law had cost the party a shot at forcing Democrats to consider a serious debt-reduction plan.

“This package is a joke compared to what we could have gotten if we had a more reasonable approach,” said Sen. Lindsey O. Graham (R-S.C.) “For the party, this is a moment of self-evaluation. We are going to assess how we got here. If we continue down this path, we are really going to hurt the Republican Party long term.”

Democrats, for their part, quietly recorded a partisan victory. But after a shutdown and debt-limit fight estimated to have sucked as much as $20 billion out of the U.S. economy, there was no celebration.

“I’m tired,” Reid said after the Senate voted Wednesday night. “Concluding this crisis is historic. But let’s be honest: This was pain inflicted on the nation for no good reason.

“We cannot — we cannot, cannot — make the same mistakes again.”

Leah Binkovitz, Jackie Kucinich and David A. Fahrenthold contributed to this report.