House Speaker John Boehner said Tuesday there were "a lot of opinions about what direction to go" on government shutdown negotiations after a meeting with House Republicans. (The Washington Post)

A campaign to persuade House Republicans to lift the federal debt limit collapsed in humiliating failure Tuesday, leaving Washington careering toward a critical deadline just two days away, with no clear plan for avoiding a government default.

Senate leaders quickly moved to pick up the pieces, saying they were “optimistic” that they could reach agreement to advance an alternative proposal that would raise the debt limit through Feb. 7 and end a government shutdown, now in its third week.

But it was unclear whether a deal struck by Senate Majority Leader Harry M. Reid (D-Nev.) and Minority Leader Mitch McConnell (R-Ky.) could pass the Senate before the Treasury Department exhausts its borrowing power Thursday.

Meeting that deadline would be impossible if Sen. Ted Cruz (R-Tex.) or other conservative hard-liners chose to throw up roadblocks, Democrats said. Republican leaders were leaning on Cruz and his allies to avoid unnecessary delays.

“The clock is ticking,” said Sen. John Thune (R-S.D.), the No. 3 Republican in the Senate. “Given the consequence of what we’re talking about here, . . . I would hope that we would have genuine interest among all parties in terms of trying to get this done as quickly as possible.”

Finding common ground hasn’t been easy for lawmakers during the Obama administration.

Any deal would also have to win approval in the House, where Speaker John A. Boehner (R-Ohio) and his leadership team had once again lost all control of their majority. After a long day of trying with increasing desperation to cobble together a debt-limit plan that could win the support of 217 Republicans, Boehner and his top deputies gave up and abruptly canceled a scheduled vote on the measure.

(Related: Who controls the House GOP? No one.)

On Tuesday evening, they left the Capitol without further plan or explanation.

“We are done for the night,” a weary Majority Whip Kevin McCarthy (R-Calif.) said as he left a marathon session in Boehner’s office that began as an airing of complaints from rebellious conservatives and soon ballooned into a full-blown emergency session of senior lawmakers and committee chairmen.

The chaos on Capitol Hill was already reverberating through the financial world. U.S. financial markets closed down slightly Tuesday, while Fitch Ratings, the third-largest credit-rating agency, took a step toward a potential downgrade of the government’s AAA rating. Fitch warned that “political brinksmanship and reduced financing flexibility” were elevating the risk of default.

Unless Congress acts by Thursday, Treasury Secretary Jack Lew will be left with just $30 billion in cash and a fluctuating flow of incoming tax revenue to pay the nation’s bills. While Lew is unlikely to begin missing payments immediately, independent analysts say he would run short of funds no later than Nov. 1.

Sen. Richard J. Durbin (D-Ill.) told reporters that aides to the two Senate leaders would work through the night to finalize details of the emerging Senate measure. “They had a basic agreement,” Durbin said of Reid and McConnell. “All pointing in the right direction.”

McConnell spokesman Don Stewart added in a statement: “Given tonight’s events, the Leaders have decided to work toward a solution that would reopen the government and prevent default. They are optimistic an agreement can be reached.”

In addition to lifting the $16.7 trillion debt limit, the emerging measure would fund the government through Jan. 15, delaying the next threat of a shutdown until after the holidays. It would set up a conference committee to hammer out broader budget issues, such as whether to replace deep cuts to agency budgets known as the sequester with other savings.

Related: The Take: How many rounds will Washington go?

Republicans who shut down the government in a bid to undermine President Obama’s health-care program would win no major changes to the law. But they would get additional safeguards to ensure that people who receive subsidies to buy health insurance are in fact eligible.

Democrats dropped their demand to delay a new tax on existing health insurance plans, a change intended to benefit organized labor. And Republicans backed off their push to deny the Treasury Department flexibility to manage the nation’s books after Feb. 7, an aborted attempt to ensure that the short-term extension of the debt limit doesn’t somehow drag on into the spring.

Durbin, the Senate’s No. 2 Democrat and chief vote counter, predicted that the final package would easily pass the Senate with support from both parties.

“With McConnell’s name on it,” he said, “we feel it will get a good, strong vote.”

Its fate in the House, however, was uncertain. Minority Leader Nancy Pelosi (D-Calif.) has pledged the support of all 200 Democrats, meaning Boehner would have to supply almost two dozen votes.

Late Tuesday, Democrats — and some Senate Republicans — were urging Boehner to draft the emerging Senate deal into legislation and let the House vote as soon as Wednesday. Given a House-passed bill, Reid could move much more quickly to final passage in the Senate, sending a bill to Obama’s desk before the Thursday deadline if Cruz and his allies did not object.

House GOP officials said they had yet to decide how to proceed. Passing the Senate bill before the Senate had even taken a vote would amount to a complete capitulation to the upper chamber, the latest embarrassment in a speakership riddled with dark moments.

Ironically, the current debacle began with Boehner’s friends in the Senate — recognizing that McConnell was close to a deal with Reid — deciding to pause those talks to give Boehner a chance to consolidate his weakening hold on power.

If Boehner had been able to rally support for a measure more palatable to Republicans, it would have strengthened McConnell’s hand.

Boehner “would establish himself as the leader of the House, which is good for the country,” Sen. Lindsey O. Graham (R-S.C.) told reporters as he left the Senate GOP’s weekly luncheon Tuesday afternoon. “This is offense for us,” Graham said optimistically. “This is a defining moment for the speaker.”

Graham, Saxby Chambliss (Ga.) and other GOP senators had pleaded with Boehner late last week to try to pass a bill that would give Senate Republicans leverage in their talks with Reid. On Monday, Boehner met with McConnell and several other Senate Republicans. And on Tuesday, Boehner was ready to go.

He started the day by convening a 9 a.m. meeting of his rank and file, a session that opened with a prayerful group sing-along to the hymn “Amazing Grace.” But as Boehner began searching for items to attach to the debt-limit bill, his majority quickly dis­integrated into squabbling ideological factions.

Boehner’s initial proposal was to include two provisions that would have given conservatives some small measure of satisfaction in exchange for ending the government shutdown and raising the debt limit. One would have delayed a tax on medical devices that helps finance the new health-care law. The other would have ended employer-provided health subsidies given to lawmakers and members of the executive branch, who are required to join the new health-care exchanges.

But conservatives quickly complained that it wasn’t enough. The bill would not cut spending, they said, or reform entitlement programs, or erase a clause in the health law that requires employers to provide coverage for contraception. And it clearly would not achieve their ultimate goal of ending the program they call Obamacare.

As the bickering continued, senior aides to rank-and-file Republicans resorted to watching the Twitter feeds of congressional reporters to learn who was demanding what.

By midafternoon, House leaders appeared to be rallying around a new measure. This one would not delay the medical-device tax, but it would add congressional staffers to the group of federal employees who would no longer receive any help from their employer to buy health insurance.

The proposal amounted to a $5,000 pay cut for those with individual coverage and a $10,000 cut for those with families. But conservatives theorized that Senate Democrats would have to approve it or risk looking as if they were protecting their own health benefits. And that would motivate them to reopen the health-care law, the theory went.

House leaders scheduled a vote for late Tuesday evening.

But in the end, that idea didn’t fly either. One by one, recalcitrant lawmakers were dragged to Boehner’s office. One by one, they emerged shaking their heads.

“I’ve got one vote and I’m a no,” Rep. Thomas Massie (R-Ky.), one of the most conservative House members, told waiting reporters.

Mainstream conservatives were also unhappy. After shutting the government down for 15 days, they would get nothing — not even the meager concessions McConnell and Reid had been discussing.

The final blow came shortly after 5 p.m., when Heritage Action for America, the powerful conservative group that drove Republicans to attack Obama’s health-care initiative, sent an e-mail urging lawmakers to vote no because the House bill “will do nothing to stop Obamacare’s massive new entitlements from taking root.”

Soon after, Boehner canceled the vote. An hour later, Majority Leader Eric Cantor (R-Va.) issued an alert telling lawmakers that the House would be in session Wednesday. No specific legislation was listed for consideration.

As for the timing of any votes, Cantor advised: “TBD.”

Rosalind S. Helderman and Jackie Kucinich contributed to this report.