Washington - With a potential debt default looming, Senate leaders are nearing completion on a deal to stave off a self-inflicted political calamity that would shred US credibility and rock the global economy.
Signs of hope emerged on Monday, three days before a deadline to raise the US government's borrowing limit and as a partial government shutdown enters its third week.
After several failed attempts to end the impasse, veteran political prize fighters Senate Majority Leader Harry Reid and his Republican opposite number Mitch McConnell conducted low-key talks aimed at saving the day.
"I'm very optimistic we will reach an agreement that's reasonable in nature this week to reopen the government, pay the nation's bills and begin long-term negotiations to put our country on sound fiscal footing," Reid said.
At the conclusion of Monday's Senate session, he said that "we are not there yet, but tremendous progress" has been made, in words that eased tension on the markets.
The Dow Jones Industrial Average closed 0.42% higher at 15 301.26 while the broader S&P 500 rose 0.41% to 1 710.14.
Asian markets broadly rose on Tuesday on prospects of a Washington deal.
Tokyo gained 0.47% in early trade, while Hong Kong rose 0.68% and Seoul climbed 0.96% higher.
"Everyone just needs to be patient," Reid said, adding that he hoped Tuesday "will be a bright day".
McConnell added: "I share his optimism that we are going to get a result that will be acceptable to both sides".
Their comments were the strongest sign yet that Republicans and Democrats - in the Senate at least - want to end the damaging political crisis that has dented the country's international standing.
The Reid-McConnell effort is clearly the last chance to reach a deal before the US Treasury exhausts its borrowing authority, but its success is far from assured.
Should the Democratic-led chamber coalesce on an agreement, the focus would then shift to whether Republican House Speaker John Boehner can secure sufficient support from his restive conservative coalition in the lower chamber to send it to Obama's desk.
But with progress apparent, and White House sources saying the feeling there mirrored the optimism in the Senate, Obama cancelled a meeting he had called with Reid, McConnell, Boehner and Democratic House Minority Leader Nancy Pelosi.
An official said the talks were put off to "allow leaders in the Senate time to continue making important progress towards a solution that raises the debt limit and reopens the government".
The Senate Republicans were to convene on Tuesday at 1500 GMT to review the plan.
The sudden optimism contrasted with Obama's terse tone of a few hours earlier, when he lambasted Republicans and warned of the consequences if a deal was not soon reached.
"If Republicans aren't willing to set aside their partisan concerns in order to do what's right for the country, we stand a good chance of defaulting and defaulting could have a potentially ... devastating effect on our economy," Obama said.
If Congress does not raise the $16.7 trillion debt ceiling by Thursday, the US government will begin to run out of money and could start defaulting on its obligations.
But it was clear on Monday that Reid and McConnell were coming together on a framework agreement.
The Politico news organisation reported that the initiative would fund government through 15 January and raise the debt ceiling until 7 February.
It would also launch formal long-term budget talks between Democrats and Republicans that would need to conclude by 13 December.
Republicans had sought a delay of the medical device tax which helps fund the president's health care reforms, but Democratic leadership resisted and it is unlikely to be part of the deal.
The two sides instead are considering delaying another "Obamacare"-related tax known as the re-insurance tax.
"The general framework is there, there might be some accoutrements that are still being fleshed out," Republican Senator Bob Corker told reporters.
Meanwhile the world seemed to be holding its collective breath.
China and Japan - which between them hold more than $2.4 trillion of US debt - have urged Washington to get its house in order.
"The United States is the largest economy in the world and we hope that it can show its responsibility," China's foreign ministry spokesperson Hua Chunying said in Beijing, taking the chance to caution Washington.
Bank of France Governor Christian Noyer warned of dire consequences if there was no solution, while US Treasury Secretary Jacob Lew told the International Monetary Fund last week that Washington understood its reputation as a safe harbour was at risk.
As the new plan is pressed forward there could be further Republican resistance, first in the Senate and then on the approach that will be adopted by the House.
Boehner faces Tea Party-backed conservatives who oppose almost any deal that does not include anti-Obamacare provisions or which fails to rein in federal spending.
Number two House Republican Eric Cantor said leadership has "not made any decision" yet on selling the potential deal to the rank-and-file.
"We will meet with our members in the morning and determine the best path forward," he said.