A day of political disarray Tuesday pushed America to within hours of a debt default deadline, but two veteran senators chased a last-gasp deal to stave off a sudden shock to the global economy.
Just 26 hours before the US government begins to run short of money to pay its bills, hopes for an exit strategy rested with late-night talks between Senate majority leader Harry Reid and Republican minority leader Mitch McConnell.
The two old foes saddled up after efforts by the House of Representatives to send a bill to the Senate dissolved into chaos, as Speaker John Boehner tried and failed to rein in Tea Party conservatives.
If Congress fails to raise US borrowing authority before midnight Wednesday (0400 GMT Thursday) the US Treasury would begin to run out of money to meet all US obligations and slip towards a historic debt default.
In the face of the deadline, the US political system, divided between President Barack Obama's Democrats and Republicans who run the House of Representatives, has effectively ground to a halt.
Major world powers meanwhile looked on in dismay at the brinkmanship and political recriminations in Washington, fearing reverberations that could wreak havoc in their own sometimes weakened economies.
Amid rising anxiety on the markets, the financial rating agency Fitch put the United States on warning for a downgrade from its top-grade AAA spot.
Despite the deepening impasse, Obama said he still expected the issue would be resolved in the end.
"My expectation is that this gets solved, but we don't have a lot of time," he told an ABC television affiliate in New York.
"What I'm suggesting to the congressional caucus is to avoid any posturing ... do what's right, open the government and make sure we pay our bills."
What was essentially a wasted day, with precious few hours to spare Tuesday, unfolded as House Republicans tried to extend US borrowing authority until February 7 and re-open the partially shuttered US government until December 15.
Several draft bills would have constrained aspects of Obama's signature health care law -- and in effect stood no chance to pass the Democratic-led Senate.
But Boehner used the measures to try to corral the Tea Party faction and to pressure the Senate -- but in the end was unable to amass sufficient Republican votes to even put the measures on the floor.
Senate talks, which had been on hold all day pending developments in the House, were quickly resumed on Tuesday evening.
Leadership aides on both sides said they were "optimistic" that an agreement was in reach.
"We're making very very good progress, we're not there yet, but we're getting real close," said Democratic Senator Chuck Schumer.
"I think the markets should feel pretty good about what's going on here tonight."
The likely Senate deal would require Democrats to make a minor concession on Obamacare, but the provision would fall well short of the drive to delay or defund the historic law which prompted Republicans to launch the government shutdown strategy and to use the debt ceiling hike as leverage.
Earlier, Reid furiously accused Boehner of seeking to save his own political skin at the expense of the United States.
"Let's be clear: The House legislation will not pass the Senate," Reid said. "I am very disappointed with John Boehner, who would once again try to preserve his role at the expense of the country."
Boehner may once again Wednesday be left with the unenviable choice that has come to define his speakership in Washington's divided government.
Does he stick with the Tea Party faction of his party, and possibly save his job but risk culpability in sending the US economy into a first default of modern times?
Or does he try to pass a compromise plan acceptable to Senate Democrats and Obama, with the help of minority Democratic votes -- a scenario that could fritter away his party power-base and possibly cost him his job?
China and Japan, which between them hold $2.4 trillion in US Treasuries, are already alarmed at the implications of the crisis.
Japan's Finance Minister Taro Aso said many US politicians "don't seem to understand well the magnitude of the international impact this problem could have."
And China's Vice Finance Minister Zhu Guangyao, in Beijing, said: "We demand that the US side, as the issuing country of the major reserve currency ... should undertake its due responsibility."
Investors endured a roller-coaster day. US stock markets closed down after a day of wild fluctuations, with the Dow Jones Industrial Average shedding 133.25 points (0.87 percent) to 15,168.01.
The broader S&P 500 fell 12.08 (0.71 percent) to 1,698.06, and the Nasdaq Composite lost 21.26 (0.56 percent) at 3,794.01.
The State Department, meanwhile, warned that dysfunction in Washington undermined America's image abroad.