WASHINGTON — Congressional Republicans conceded defeat on Wednesday in their bitter budget fight with President Obama over the new health care law as the House and Senate approved last-minute legislation ending a disruptive 16-day government shutdown and extending federal borrowing power to avert a financial default with potentially worldwide economic repercussions.

With the Treasury Department warning that it could run out of money to pay national obligations within a day, the Senate voted overwhelmingly on Wednesday evening, 81 to 18, to approve a proposal hammered out by the chamber’s Republican and Democratic leaders after the House on Tuesday was unable to move forward with any resolution. The House followed suit a few hours later, voting 285 to 144 to approve the Senate plan, which would fund the government through Jan. 15 and raise the debt limit through Feb. 7.

Mr. Obama signed the bill about 12:30 a.m. Thursday.

Most House Republicans opposed the bill, but 87 voted to support it. The breakdown showed that Republican leaders were willing to violate their informal rule against advancing bills that do not have majority Republican support in order to end the shutdown. All 198 Democrats voting supported the measure.