Senate leaders have announced a bipartisan deal to avert a threatened US default and reopen the federal government.
The move should end a prolonged fiscal crisis that gripped Washington, battered Republican approval ratings and threatened the global economy with a new recession.
Congress was gearing up to pass the measure before the day was out.
Senate Majority Leader Harry Reid and Minority Leader Mitch McConnell announced a plan that would fund the government through January 15 and allow the Treasury to increase the nation's borrowing authority through February 7.
Both the Democrat-controlled Senate and Republican-controlled House of Representatives must approve the plan, which President Barack Obama would then sign before tomorrow's deadline for Congress to increase the federal debt limit.
Mr Obama applauded the Senate compromise and hoped to sign it into law, White House Jay Carney spokesman said.
And Speaker John Boehner said he would bring the Senate measure to the floor of the House of Representatives for a vote.
But he did not move to that position quietly, saying Republicans were not giving up on the fight to bring down US debt and cripple "Obamacare," as the president's signature health care overhaul is known.
"Our drive to stop the train wreck that is the president's health care law will continue," Mr Boehner said in a statement.
With the deal announced, US stock indexes jumped by more than 1% in trading late in the market day.
Mr Reid, leader of Senate Democrats, thanked Mr McConnell for working with him to end what had become one of the nastiest partisan battles in recent Washington history.
"This is a time for reconciliation," said Mr Reid.
A long line of polls charted a steep decline in public approval for Republicans in the course of what Republican Senator John McCain pronounced a "shameful episode" in US history.
Republicans were left with little to show for their fight - in political terms, the final agreement was almost entirely along lines Mr Obama had set when the impasse began last month.
The deal would end the bitter stand-off for now, giving both parties time to cool off and come up with a broader budget plan or risk repeating the damaging cycle again in the new year.
The crisis began on October 1 with a partial shutdown of the federal government after House Republicans refused to accept a temporary funding measure unless Mr Obama agreed to defund or delay his health care law, known as "Obamacare."
It escalated when House Republicans also refused to move on needed approval for raising the amount of money the Treasury can borrow to pay US bills, raising the spectre of a catastrophic default. Mr Obama vowed repeatedly not to pay a "ransom" in order to get Congress to pass normally routine legislation.
The hard-right tea party faction of House Republicans, urged on by conservative Texas Republican Ted Cruz in the Senate, had seen both deadlines as weapons that could be used to gut Mr Obama's Affordable Care Act, designed to provide tens of millions of uninsured Americans with coverage.
The Democrats remained united against any Republican threat to Mr Obama's signature programme, and Republicans in the House could not muster enough votes to pass their own plan to end the impasse.
Mr Cruz said after the deal was announced that he would not block a vote. That was a key concession that signalled a strong possibility that both houses could act by day's end. That, in turn, would allow Mr Obama to sign the bill into law ahead of the deadline that Treasury Secretary Jacob Lew had set for action to raise the debt limit.
Mr McConnell said the time had come to back away for now from Republican efforts to undermine "Obamacare." But the feisty minority boss said Republicans had not given up on erasing it from the legislative books.