The Senate voted 81-18 to halt the 16-day government shutdown and raise the U.S. debt limit, moving one step closer to ending the nation’s fiscal impasse.

The House of Representatives plans to vote later tonight and President Barack Obama supports the agreement. The Senate acted the day before U.S. borrowing authority was scheduled to lapse as Congress engaged in its fourth round of fiscal brinkmanship in less than three years.

All of the votes against the proposal were from Republicans. One senator, Republican James Inhofe of Oklahoma, was absent.

“This is pain inflicted on our nation for no good reason,” Senate Majority Leader Harry Reid said after the vote. “We cannot make the same mistake again.”

The agreement would put federal workers back on the job, prevent a potential default on U.S. debt and make no major policy changes sought by Republicans. Lawmakers didn’t resolve any of their long-term divides on fiscal policy and will have to return to the same issues over the next four months.

The deal concludes a four-week fiscal standoff that began with Republicans demanding defunding of Obama’s 2010 health-care law and objecting to raising the debt limit and financing the government without attaching policy conditions. They achieved almost none of those goals in the agreement.

“We fought the good fight,” House Speaker John Boehner, a Republican, said today on Cincinnati’s WLW, a radio station in his home state of Ohio. “We just didn’t win.”

The framework negotiated by Reid and Minority Leader Mitch McConnell would fund the government at Republican-backed spending levels through Jan. 15, 2014, and suspend the debt limit through Feb. 7, setting up another round of confrontations then.

“This agreement achieves what is necessary,” said Jay Carney, the White House press secretary.

The Senate accord was unveiled a day after Fitch Ratings put the U.S. AAA credit grade on ratings watch negative, citing the government’s inability to raise the debt ceiling in a timely manner, according to a statement after markets in New York closed yesterday.

U.S. stocks rallied, sending the Standard & Poor’s 500 Index toward a record. The benchmark index rose 1.4 percent to 1,721.47 at 4 p.m. in New York after sliding 0.7 percent yesterday. The Dow Jones Industrial Average rose 205.82 points, or 1.4 percent, to 15,373.83.

Rates on Treasury bills tumbled and yields on government notes and bonds fell. One-month rates fell 21 basis points, or 0.21 percentage point, to 0.13 percent at 4:06 p.m. in New York after touching 0.45 percent, the highest since October 2008, according to data compiled by Bloomberg. The benchmark 10-year yield fell six basis points to 2.67 percent, according to Bloomberg Bond Trader data.

The partial shutdown has closed national parks, slowed clinical drug trials and led to the furlough of thousands of federal workers. The Senate proposal would provide back pay for furloughed workers.

The shutdown took at least $24 billion out of the U.S. economy, S&P said in a report today.

The U.S. Chamber of Commerce, the country’s largest business group, supports the agreement. Several small-government groups, including the Club for Growth and Heritage Action for America, are urging lawmakers to vote against the accord.

House Republicans met for about 30 minutes today, and Boehner didn’t speak to reporters as he left the session. The speaker received a standing ovation at the meeting, said Representative Lynn Westmoreland, a Georgia Republican.

“Everybody appreciates what the speaker has done up till now and the whole leadership stuck together,” Westmoreland said.

Under the Senate agreement, House Republicans achieved almost none of their priorities.

“If there is a silver lining in this cloud, it’s that hopefully this debacle means that the power of those that favor confrontation has peaked,” Senator Charles Schumer, a New York Democrat, said in a statement.

Republicans persisted after the partial government shutdown started Oct. 1 and their approval ratings dropped in polls. Hardliners resisted plans that didn’t make major changes to the Patient Protection and Affordable Care Act.

Obama described those requests for health-law changes as unacceptable ransom demands and insisted that Republicans relent.

Senator Kelly Ayotte, a New Hampshire Republican, questioned some other Republicans’ approach to the health law.

“If they’re saying the defunding issue is going to come up again in three months, then they’ve learned nothing from this,” she said. “I hope we learned that we shouldn’t get behind a strategy that cannot succeed.”

Senator Ted Cruz, a Texas Republican who spoke against the health law for 21 hours last month, said on the Senate floor before the vote tonight that the deal “embodies everything that frustrates the American people about Washington.”

Representative Dave Camp, chairman of the House Ways and Means Committee, said Republicans will turn to oversight of the implementation of the health care law.

Some House Republicans said they wouldn’t vote for the Senate agreement.

“You will definitely see a split vote tonight,” said Thomas Massie, a Kentucky Republican. “I have one vote: I am going to vote no.”

‘Political Establishment’

The Senate agreement trades the pressing and already-missed deadlines for new ones over the next four months. The Treasury Department would be allowed to use so-called extraordinary measures to delay default for three to four weeks beyond Feb. 7, said a Senate Democratic aide who spoke on condition of anonymity to discuss the plan.

“It would appear as though we’re kicking the can down the road one more time,” Representative Jim Bridenstine, an Oklahoma Republican, said in an interview. “It’s a problem. Neither side is negotiating so we kicked the can and now we’re going to have to deal with it.”

The bill authorizes more than $1 billion for a dam project on the Illinois-Kentucky border. Don Stewart, a spokesman for McConnell, said in an e-mail that appropriators, not the minority leader from Kentucky, requested the project.

The measure includes as much as $450 million for repairs to wildfire damage in Colorado. It also would freeze the pay of members of A Republican-backed provision in the agreement requires the Health and Human Services Secretary, Kathleen Sebelius, to certify that the government is able to verify the incomes of people who apply for government subsidies to help pay their insurance premiums under the Affordable Care Act.

Sebelius would have to submit a report by Jan. 1, 2014, on the income verification process. The inspector general for Sebelius’s department would have to issue a report on the effectiveness of the process by July 1, 2014.

“We can finally reopen the government,” said Senator Sherrod Brown, an Ohio Democrat. “We’re finally going to do the right thing.”

The bill is HR 2775.