PHOTOS: The battle over Obamacare

But many of the conservative Republicans who pushed their party to pursue the shutdown strategy criticized the compromise as a betrayal of principle.

Sen. Ted Cruz of Texas, who had led the effort, used his final speech before the vote to blast fellow GOP senators, accusing them of directing "cannon fire at House Republicans" rather than uniting to fight the Democrats.

"If all 46 Senate Republicans had stood together and simply supported House Republicans" in their votes to block the healthcare bill, "this result, I believe, would have been very, very different," he said.

Cruz and his allies agreed, however, not to use a filibuster or other delaying tactics to block the compromise from passing the Senate.

"Of course not; never had any intention to delay this vote," he said to cameras outside the Senate chamber while McConnell was on the Senate floor announcing the deal — an unusual breach of Senate courtesy.

"Delaying this vote would not accomplish anything."

In the House, Boehner also said his Republican majority would not block the bill.

"The House has fought with everything it has to convince the president of the United States to engage in bipartisan negotiations aimed at addressing our country's debt and providing fairness for the American people under Obamacare," the speaker said in a statement.

QUIZ: Test your knowledge of the debt limit

"That fight will continue. But blocking the bipartisan agreement reached today by the members of the Senate will not be a tactic for us," he said.

During a private meeting with GOP lawmakers, Boehner acknowledged that they had lost the shutdown battle. Noting the exhaustion that had settled over the Capitol, he encouraged them to get some sleep, saying they would resume the fight another day, according to House members who were in the room.

The bill includes one change in the healthcare law: It requires the government to verify the income of those Americans who receive financial help in buying insurance through the new online healthcare marketplaces. Democrats did not object to the provision; they said it largely repeated language already in the law.

The measure provides funding to keep the government running through Jan. 15 and authorizes back pay for furloughed federal workers.

It allows borrowing to continue through Feb. 7, but the Treasury could use so-called extraordinary measures to temporarily pay bills after that date. So the next debt ceiling crunch probably would not occur until spring.

The temporary nature of the agreement all but ensures another budget battle this winter, unless a House-Senate conference committee established by the deal can work out an agreed-upon spending plan. The panel has until Dec. 13 to come up with one. The goal would be to avert another round of automatic "sequester" cuts that many in both parties want to avoid. Congress did not give federal agencies the flexibility that some lawmakers had sought for handling that next round of cuts.

The compromise also includes a provision, similar to one passed two years ago, that would allow Congress to take a vote, probably later this month, disapproving a debt increase, which Obama could veto. The measure is designed to allow lawmakers to go on record as opposing more debt without actually affecting the Treasury.

As is often the case with such "must pass" legislation, the deal took on several other provisions of importance to specific senators.

It includes a provision, previously approved by the Senate, that would allow officials in flood-damaged Colorado to tap as much as $450 million in federal emergency highway money to repair roads, lifting a $100-million cap on the emergency funds the state is eligible to obtain. Additional money to fight wildfires had also been in earlier funding bills and was included in the final deal.

The measure includes $2 billion for completion of locks and dams on the Ohio River in Illinois and Kentucky. The Senate Conservatives Fund, which backs conservative candidates for Senate seats, accused McConnell of obtaining the money as an "earmark" and labeled the provision the "Kentucky kickback."

Senate officials from both parties, however, insisted that McConnell had little to do with the request for that money. The funds had been included in Obama's budget this year. Without the money, work on the projects would have to stop later this year, the Senate officials said, speaking anonymously because they had not been given permission to discuss the matter on the record.