Media playback is unsupported on your device Media caption The debt ceiling explained in 90 seconds

Frantic US political attempts to avert a federal debt default have pivoted back to the Senate after plans in the House of Representatives collapsed.

Upper chamber leaders resumed work overnight on a deal to raise the US borrowing limit and end a partial government shutdown.

Amid the congressional disarray, a top ratings agency warned of a possible downgrade in US creditworthiness.

The US must raise its $16.7tn (£10.5tn) debt limit by Thursday or risk default.

Politicians, bankers and economists have warned of global economic consequences unless an agreement can be reached.

To the bystander (and unfortunately none of us can really be dispassionate bystanders on this, because if the dollar goes pop, we're all covered in goo), what's going on looks odd

The Democratic-controlled Senate took control on Tuesday night, working on a bipartisan deal that aides said would extend the federal borrowing limit until 7 February and fund the government to mid-January.

'Deadbeat nation'

Senate Democratic leader Harry Reid and his Republican counterpart, Mitch McConnell, were expected to brief their colleagues on Wednesday.

The Senate is due to reconvene at noon (16:00 GMT).

But even if a compromise can overcome procedural hurdles, it remains unclear whether it can muster enough votes in the Republican-led House to pass before the 17 October deadline.

US media reaction The Wall Street Journal writes: "None of this is worth a partial government shutdown, much less the risk of a debt default, and both sides are looking like losers." The New York Times urges an end to "debt-ceiling moments", making them "less fraught with peril, less prone to stalemate and more conducive to productive negotiations". The Republicans, says The Washington Post, seem "determined to thrash about in search of something it can call a political win for a few more hours, or days". The Los Angeles Times compares the Republican leaders of the House and Senate saying the latter, Mitch McConnell, has been able to "discern when his party is holding a losing hand and make the decision to cut a deal".

Democratic Senator Barbara Mikulski warned her colleagues that the US was "hours away from becoming a deadbeat nation, not paying its bills to its own people and other creditors".

The Senate's negotiations were initially put on hold on Tuesday to give House Republicans a chance to come up with a deal.

But the lower chamber's efforts ended in chaos after two proposals floated in the space of a few hours were torpedoed from right and left, forcing the leadership to shelve plans for a vote.

Embattled House Speaker John Boehner failed to rally his fractious rank-and-file Republicans behind either plan.

Amid the legislative turmoil, the Fitch credit agency warned it could downgrade the US government's AAA rating, while the Dow Jones index ended the day down 133 points.

On Tuesday afternoon, President Barack Obama told a local ABC broadcaster he expected the debt ceiling impasse would be resolved.

US Treasury payments due 23 October: Social Security benefits $12bn 28 October: Federal employee salaries $3bn 30 October: Medicaid payments to providers $2bn 31 October: Interest payment on public debt $6bn 1 November: Medicare payment to providers & plans $18bn; Social Security benefits $25bn; military active pay, retirement and veteran benefits $12bn; supplemental security income benefits $3bn 14 November: Social Security benefits $12bn 15 November: Interest payment on debt $29bn Note: These are the key payments, not all the payments, the US Treasury must make in the next month

But he added: "I think the House Republicans still believe they can get concessions for doing their job."

Hardline conservatives triggered the budget warfare 16 days ago, forcing the first government shutdown in 17 years by demanding that Mr Obama gut his signature healthcare overhaul.

By Tuesday afternoon, the House leadership was left offering a relatively modest proposal to deny discounts for lawmakers and their staff members on health insurance policies.

In the Senate plan under negotiation, Republicans may only emerge with a sop in the form of language tightening income verification for anyone seeking subsidies on medical coverage.

'That's it?'

Although both parties have fared badly in opinion polls during the fiscal standoff, Republicans have taken the brunt of the blame from voters.

As America stands on the brink of running out of money to pay its bills, the Republican leadership in the House raised pointless grandstanding to an art form

And with concerns about potential damage to the party's prospects in next year's midterm elections, the political recriminations have already begun.

Moderate Republican congressman Peter King told the Huffington Post: "After shutting down the government for two-and-a-half weeks, laying off 800,000 people, all the damage we caused, all we would end up doing was taking away health insurance from congressional employees. That's it? That's what you go to war for?"

Senator John McCain, who was the Republican 2008 presidential nominee, was quoted by the New York Times as saying: "Republicans have to understand we have lost this battle, as I predicted weeks ago, that we would not be able to win because we were demanding something that was not achievable."

Media playback is unsupported on your device Media caption Republican House Speaker John Boehner: "No decisions about what exactly we will do"

The White House has refused to negotiate over its healthcare law, pointing out that it passed in 2010, was subsequently validated by the Supreme Court, and was a central issue in the 2012 presidential election, which Mr Obama won comfortably.