The House and Senate leaders who are forging a deal to reopen the government and avert a historic debt default still must find a way to get the votes to pass it. They are working against a five-year history of mutual acrimony, mistrust, recrimination and, strangely enough, success.

Even as Senate Majority Leader Harry Reid, D-Nev., and Minority Leader Mitch McConnell, R-Ky., reported making substantial progress in their efforts Monday — to the point that a scheduled bicameral meeting at the White House was postponed to give them more time to finish their work — the deal-making echoed their earlier work in 2008, when the two senior senators helped shepherd the Wall Street bailout known as the Troubled Asset Relief Program to final passage.

The landscape, of course, has changed dramatically in the five years since the top congressional leaders worked furiously over a weekend to save the nation from the brink of an apocalypse. With the economy in the midst of a meltdown, partisan and personal ambitions were shunted to the side. The top leaders in both chambers and both parties essentially joined hands and jumped together.

When the $700 billion TARP bailout came to the House floor, then-Speaker Nancy Pelosi urged her members to vote for it. So did then-Minority Leader John A. Boehner, then-Chief Deputy Minority Whip Eric Cantor and a young Rep. Paul D. Ryan.

Boehner told his flock on the floor the vote would separate the men from the boys and the girls from the women. He called it a mud sandwich on the floor, and worse in private. But it had to be done, he said.

The bill failed on the first try, and 15 minutes later the Dow Jones industrial average was down 777 points. The vast majority of Boehner’s conference had voted no.

It’s just the kind of humiliating event political leaders try to avoid repeating.

That moment, which helped spawn the tea party, may help explain why Boehner has dug in so fiercely this time around, rather than — as Democrats assume he must in the end — put legislation on the floor that can only pass with mostly Democratic votes.

In 2008, it was left to Reid and McConnell to resuscitate TARP with a few amendments before it finally passed several days later.

On Monday afternoon, aides said a framework was emerging that would reopen the government until Jan. 15, extend the debt limit until February and set up a budget conference with a deadline of Dec. 15 to reach a deal, among other provisions. But all of the relationships among the top leaders have been frayed by the years of partisan trench warfare since the Wall Street bailout: the hyperpartisan first two years of the Obama administration, the 2011 debt limit fight, last year’s fiscal cliff and many smaller fights in between.

Former Sen. Judd Gregg, R-N.H., a key figure in the passage of TARP, said the biggest difference between then and now is the nature of the fight.

“This is a totally artificially created crisis, and it’s totally under the control of the Congress and the president,” he said. Because of that, “the players are much more engaged on a political level than on a substantive level.”

There also are more people in Congress now who want to “stand in the corners and shout” rather than govern, said Gregg, now the CEO of the Securities Industry and Financial Markets Association.

Gregg dismissed the GOP strategy of threatening a shutdown and default over Obamacare as doomed from the start — one where the shouting faction won out over the governing faction. “You need people who want to govern,” he said.

But the frayed relationships at the top have only hurt matters.

Hill Democrats have felt burned by both Boehner and the White House after the 2011 debt deal locked in the sequester, and again during the fiscal-cliff deal when Vice President Joseph R. Biden Jr. agreed to a deal with McConnell that locked in permanent tax relief without addressing the sequester or the debt limit.

Similarly, Boehner and McConnell’s relationship has been tense over the years, particularly since the 2011 payroll tax deal. At that time, Senate Republicans essentially banded together with Senate Democrats on a deal to extend the tax credit, a decision that jammed the House and forced it to swallow the Senate bill.

Of course, the partisan mistrust is even deeper.

Obama and Boehner’s relationship deteriorated in 2011 after Boehner twice pulled out of negotiations on a grand bargain — and Boehner in turn told his conference earlier this year that he was through trying to cut deals with Obama after a postelection fiscal-cliff effort fizzled last year.

Reid and Boehner’s relationship, while never close, has been especially chilly in recent weeks, with Reid accusing Boehner of reneging on a private deal to keep the government open. And Reid has chafed at Boehner’s recent efforts to target health care benefits of congressional staffers, given that Boehner’s staff had worked behind the scenes to find a way to allow staffers and lawmakers to continue receiving employer contributions for health insurance purchased on the Obamacare exchanges.

Meanwhile, Reid and McConnell have grown only farther apart. Both have privately and publicly accused the other of reneging on deals regarding Senate rules changes. Reid appears to be holding a grudge against McConnell for what the Nevada Democrat believes was McConnell’s influence on his hard-fought 2010 re-election race. McConnell has in turn been irritated that Reid appears to be heavily involved in helping the Kentucky Republican’s likely 2014 Democratic opponent.

And yet, before the government shut down Oct. 1, there had been a hope among Democrats that some deal-maker would emerge to avoid a calamity — and that, in the end, Boehner won’t let a default happen. So far, that still seems to be the calculus.

“The hope is that cooler heads will prevail, and I believe they will in the end,” said former Reid spokesman Jim Manley.

If they don’t, Gregg sees bad news for the GOP. “All you’ve done is undermine the full faith and credit,” Gregg said of a circumstance in which the nation goes into default.

Regardless of whether the Treasury makes its interest payments but defaults on other payments, Gregg said the impact would be significant.

“That sort of substantive default is dramatic and will have long-term impacts on the cost of our government,” he said.