WASHINGTON — With the federal government on the brink of a default, a House Republican effort to end the shutdown and extend the Treasury’s borrowing authority collapsed Tuesday night as a major credit agency warned that the United States was on the verge of a costly ratings downgrade.

After the failure of the House Republican leadership to find enough support for its latest proposal to end the fiscal crisis, the Senate’s Democratic and Republican leaders immediately restarted negotiations to find a bipartisan path forward. A spokesman for Senator Harry Reid of Nevada, the majority leader, said Mr. Reid was “optimistic that an agreement is within reach” with Senator Mitch McConnell of Kentucky, the Republican leader.

With so little time left, chances rose that a resolution would not be approved by Congress and sent to President Obama before Thursday, when the government is left with only its cash on hand to pay the nation’s bills.

“It’s very, very serious,” warned Senator John McCain, Republican of Arizona. “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.”