House Republican efforts to pass legislation averting a U.S. debt default and ending a partial government shutdown collapsed Tuesday night, and a top ratings firm warned of a possible downgrade in the country's creditworthiness.

Just hours after unveiling it, Republican leaders — apparently lacking votes from their own rank-and-file — pulled legislation to reopen the government and raise the amount of money the Treasury can borrow to pay the nation's bills.

The setback came just two days before the Obama administration says the government will be out of money to pay debts.

Time growing desperately short, Senate leaders took command of efforts to avert a Treasury default and end the partial government shutdown Tuesday night after a last big attempt by House Republicans abruptly collapsed.

We are 33 hours from becoming a deadbeat nation. - Senator Barbara Mikulski, Maryland Democrat

Aides to both Senate Majority Leader Harry Reid and the Republican leader, Mitch McConnell, expressed revived optimism about chances for a swift agreement — by Wednesday at the latest — that could pass both houses. Their efforts toward a bipartisan resolution had seemed likely to bear fruit a day earlier before House conservative were given a last-minute chance for their version.

Likeliest compromise would last until February

As hours ticked down toward Thursday's Treasury deadline, the likeliest compromise included renewed authority for the Treasury to borrow through early February and the government to reopen at least until mid-January.

U.S. House Minority Leader Nancy Pelosi spoke with reporters before going to the White House to meet with President Barack Obama Tuesday. (The Associated Press) While a day of secret meetings and frenzied manoeuvring unfolded in all corners of the Capitol, Senator Barbara Mikulski, a Democrat from Maryland, stood on the Senate floor at midafternoon and declared, "We are 33 hours away from becoming a deadbeat nation, not paying its bills to its own people and other creditors."

In New York, the stock market dropped and the Fitch rating agency warned that it was reviewing the government's AAA credit rating for a possible downgrade, though no action was near. The firm, one of the three leading U.S. credit-ratings agencies, said that "the political brinkmanship and reduced financing flexibility could increase the risk of a U.S. default."

According to Treasury Secretary Jacob Lew, unless Congress acts by Thursday, the government will lose its ability to borrow and will be required to meet its obligations relying only on cash on hand and incoming tax receipts. President Barack Obama and numerous other officials in government and finance have warned of severe economic consequences if federal obligations come due that can't be paid.

By all accounts, though, an end seems near for the impasse that has once again exposed a government so divided that it sometimes borders on dysfunction. Though the House failed to muster sufficient support for a conservatives-only bill in the Republican-majority chamber on Tuesday, enough Republicans there seem likely to join House Democrats to approve a bipartisan version if it can be approved by the Senate and sent to them.

Republicans blamed more than Democrats

Politically, neither party is faring well, but polls indicate Republicans are bearing the brunt of public unhappiness as survey after survey shows their approval ratings plunging.

U.S. Senate Majority Leader Harry Reid said John Boehner had "once again tried to preserve his role at the expense of the country." (Joshua Roberts/Reuters) There was no indication Tuesday night of the terms of a possible deal under discussion by Reid and McConnell, although the contours of an agreement had already come into shape on Monday, before what amounted to a daylong detour to give Speaker John Boehner and House Republicans time to craft their solution.

As it stood previously, the bipartisan Senate talks were focused on a plan to allow the Treasury to borrow freely through Feb. 7 and reopen the government with enough funds to carry over to mid-January.

Congressional negotiators would be appointed to seek a long-term deficit reduction plan, and in the meantime federal agencies would receive increased flexibility to deal with the impact of across-the-board spending cuts due to take effect on about Jan. 15.

With Republicans opposed, the likelihood faded for including an earlier proposal to delay a $63-per-person fee (US) that the nation's health care overhaul would impose on companies for all who receive coverage under an employer-provided plan.

It appeared likely that any deal would include a provision requiring the Department of Health and Human Services to verify the income of individuals seeking federal subsidies to purchase coverage under Obamacare.

Before Tuesday was devoted to the effort of the House Republicans, those Senate negotiations had seemed headed for success.

House Republican officials unveiled their measure at midmorning, then revised it in hopes of building more support. In its final public form, it would have permitted the Treasury to borrow normally until Feb. 7 and the government to reopen with sufficient funds to carry it to Dec. 15.

Additionally, members of Congress, the president, vice-president and thousands of aides would no longer be eligible to receive employer health care contributions from the government that employs them.

The leadership projected confidence, and Michael Steel, a spokesman for Boehner said in a statement, "The House will vote tonight to reopen the government and avoid default."

Within a few hours though, objections came from all corners of the rank and file. And Heritage Action, a group with Tea Party ties, announced its opposition to the measure it said "will do absolutely nothing to help Americans who are negatively impacted by Obamacare." It said it would include the vote in its determinations next year on which candidates to support in the midterm elections.

Outbreak of partisan rhetoric

That verdict came after Republicans jettisoned a pair of provisions that had drawn objections from the White House and Democrats. One would have delayed a medical device tax created under the new health care law known as Obamacare. The other would have imposed tougher income verification standards on individuals and families seeking subsidies for care under the law.

I have made clear for months and months that the idea of default is wrong and we shouldn't get anywhere close to it. - House Speaker John Boehner

Democrats had viewed both as concessions to Republicans, and deemed their inclusion as a violation of Obama's vow not to pay a "ransom" to the GOP for passing essential funding and borrowing measures.

The day's events prompted an outbreak of partisan rhetoric, mixed with urgent warnings that both the U.S. and global economies could suffer severe damage quickly unless Congress acted by Thursday.

Even something of an appeal for heavenly aid was thrown in, as Representative Steve Southerland of Florida led House Republicans in a rendition of Amazing Grace at the beginning of a rank-and-file meeting called to discuss a way out of the impasse.

Speaking with reporters, Boehner said, "I have made clear for months and months that the idea of default is wrong and we shouldn't get anywhere close to it."

Democrats jumped on Boehner and the plan he produced.

In unusually personal remarks, Reid said the Ohio Republican had "once again tried to preserve his role at the expense of the country."

That was a reference to a rebellious rank and file in the House, who routinely seek to push Boehner and the rest of the leadership to the right. A group met Monday night with Texas Senator Ted Cruz, who last summer played a public role in a campaign to demand defunding of Obamacare as the price for preventing a partial government shutdown.