Congress passed a law Wednesday to reopen the government for three months and lift the nation’s debt ceiling, setting up another confrontation early next year and leaving Republicans with little to show for the standoff.

It was a deal struck in the Senate that tilted toward Democrats’ demands: Ending the partial government shutdown with a status quo spending bill through Jan. 15 and suspending the $16.7 trillion borrowing limit until February, though the Treasury Department can use special measures to extend that deadline.

The only change to the new health care law is a requirement that the Obama administration verify the incomes of those applying for health insurance subsidies.

“After weeks spent facing off across a partisan divide that often seemed too wide to cross, our country came to the brink of a disaster,” said Senate Majority Leader Harry Reid, D-Nev., who struck the deal with Minority Leader Mitch McConnell, R-Ky., a day before the government could no longer guarantee the ability to pay its bills.

“But in the end,” Reid said, “political adversaries set aside their differences and disagreements to prevent that disaster.”

The accord means the government’s bills will be paid without a hiccup. Furloughed federal employees will go back to work with back pay for the two-week shutdown, as government services will resume.

News of the deal gave the stock market a boost, with the Dow Jones Industrial Average and S&P 500 each up more than 1 percent.

In the Georgia delegation, Republicans Saxby Chambliss and Johnny Isakson were among 81 senators to back the bill, while all of the state’s House Republicans voted against it. Georgia’s House Democrats all were in favor of the 285-144 vote.

“We’ll live to fight another day,” Chambliss said, hoping that forthcoming budget negotiations produce something for the GOP to like. “I hope the adults in the room will work out something from a budget standpoint.”

Sens. Chambliss and Isakson briefed most of their House GOP counterparts on the deal in the afternoon.

Leaving the meeting, U.S. Rep. Lynn Westmoreland of Coweta County quipped to a lurking reporter that they had been playing poker. So who won?

“We all went all in, and we all lost,” he said.

House Republicans had pushed to strip funding from the health care law, or otherwise strike a serious blow against it, as part of a deal to keep the government open.

But when President Barack Obama and Senate Democrats refused to accept any big changes, the government partially shut down on Oct. 1.

In public polls, both parties took a hit but Republicans’ beating was worse. Cracks began to show, particularly between more moderate, deal-making Republican senators and House conservatives who wanted to hold the line against the law known as Obamacare.

Meanwhile, many Republicans felt the shutdown overshadowed a rocky opening to enrollment in the health care law — with technical glitches preventing people from buying insurance on the new state-based exchanges and few actually signing up.

The deal does keep the chopped-down yearly spending levels created in the 2011 debt ceiling deal that Democrats dislike, and the Jan. 15 expiration coincides with another $19 billion in across-the-board “sequestration” cuts.

Military officials have said the cuts are damaging national security, while domestic programs are pinched as well. Forthcoming budget negotiations could produce another confrontation on the cuts as government funding expires.

U.S. Rep. Tom Graves, a Ranger Republican who was one of the architects of the strategy to push defunding Obamacare, expected to carry on the battle.

“We’ve been most successful when we stand for — unified — behind what we believe philosophically and policywise,” Graves said. “The House is strong in that regard, and we’ll continue to do that.”

The “defund” strategy began over August and was pushed by Sen. Ted Cruz, R-Texas, and outside groups such as Heritage Action for America, which urged members to vote against Wednesday’s compromise.

Business groups such as the U.S. Chamber of Commerce, the old-time GOP establishment that was mostly quiet until Wednesday, urged a “yes” to end the debt ceiling uncertainty.

House Speaker John Boehner, R-Ohio, disliked the defund strategy and initially urged a drama-free extension of government funding and a budget negotiation around the debt ceiling, but conservatives refused and forced his hand. As the two fights merged, Democrats would not give on either point, seeing a short-term spending bill and the debt limit as essential government functions, not leverage points to make a deal.

Boehner finally gave in Wednesday and allowed a vote relying on Democrats with few Republicans, a move unpopular with the GOP. But there were no calls for the speaker’s head, as Republicans acknowledged the fight was done.

“Is it going to hurt him? Yeah, I think it will,” Westmoreland said of Boehner. “But I think what most members of our (Republican) conference realize is that he fought the battle as long as he could.”

Democrats hope the battles will subside, at least against economically damaging deadlines. Ratings agency Standard and Poor's estimated that the shutdown took $24 billion out of the economy and reduced gross domestic product growth by 0.6 percent.

“I hope and pray that … we’ve learned a lesson from this and that we will not be, we will never ever again utilize a debt ceiling like this,” said U.S. Rep. David Scott, an Atlanta Democrat. “It’s unfair to the American people.”

But these clashes have been a feature of the divided government since Republicans took over the House in 2011 and were pitted against a Democratic Senate and White House.

“We are a country that is philosophically divided — at least we don’t have a common vision of government,” said U.S. Rep. Jack Kingston, a Savannah Republican. “These fights unfortunately aren’t going to go away.”

Obama sounded a hopeful note that even if the fights continue, perhaps they won’t be conducted with such rancor.

“My hope and expectation is everybody has learned that there is no reason why we can’t work on the issues at hand, why we can’t disagree between the parties while still being agreeable, and make sure that we’re not inflicting harm on the American people when we do have disagreements,” the president said.