President Trump greets Sen. Luther Strange (R-Ala.) at a campaign rally on Friday in Huntsville, Ala. (Evan Vucci/AP)

Senate Majority Leader Mitch McConnell (R-Ky.) was already facing a perilous week ahead: another attempt to repeal the Affordable Care Act, a critical special election in Alabama and a first glimpse of the framework for a massive tax cut.

By Friday night, the repeal effort was hanging by the barest of threads, and President Trump wasn't happy about it — venting at a high-profile campaign stop about the apparent impending failure.

All of it leaves McConnell, who a few days ago was poised to score his best in the Trump era, desperately trying to mitigate his losses.

Defections from the GOP's own ranks, most notably (again) Sen. John McCain (R-Ariz.), probably ended for at least another year the bid to repeal the health-care law. Republicans may go through the motions of holding a vote in the days ahead, but it seems destined to fail unless Trump or McConnell can change several senators' minds.

The news arrived at a terrible time for the establishment wing of the Republican Party, just days before Sen. Luther Strange (R-Ala.), appointed after Jeff Sessions became attorney general, faces a conservative challenge in a Republican primary runoff to fill the seat permanently. McConnell's Washington operation fully backed Strange, and Trump was persuaded to support him as well, even flying to Huntsville, Ala., on Friday to appear onstage with the senator ahead of Tuesday's election.

Losses on both the policy agenda and the political arena in a single week would be brutal for McConnell — and could lead to another round of recriminations inside a Republican Party that is beset by division.

Such an outcome would also make it even more critical — yet all the harder — for White House officials and congressional Republicans to come together on their plan to dramatically cut taxes for businesses and individuals. That issue had been the long-planned focus for next week's agenda until the latest repeal effort crowded out everything else.

So far, Republicans have shown progress on the tax plan, trying to learn from their ACA mistakes by preemptively agreeing on the fiscal targets. But senior advisers have privately suggested that this is a project that is probably months away from fruition. And that's if all goes as planned.

Politically, this legislative quagmire probably inspires more conservatives to follow the path of Roy Moore. The controversial former state judge is challenging Strange by labeling him a McConnell crony — a member of an establishment that continues to flounder in Washington.

In the 2014 and 2016 election seasons, McConnell shepherded every single Republican incumbent who sought reelection through their primary challenges, believing that every victory by the establishment further suffocated the energy for insurgents in other states.

That may not happen this time. Moore could pull off the win with the backing of Stephen K. Bannon, the ousted White House strategist who has returned to run the Breitbart media group with promises to launch as many primary challengers as possible to McConnell's GOP incumbents. Bannon would take a victory by Moore as a selling point to some of the billionaire financiers of Trump's 2016 campaign who remain upset with McConnell and House Speaker Paul D. Ryan (R-Wis.). The ultimate goal? More funding for more primary challengers ahead of next year's midterm elections.

All of this would come as Republicans grapple with a critical decision to prop up the ACA's private insurance markets. Sens. Lamar Alexander (R-Tenn.) and Patty Murray (D-Wash.), leaders of the Senate's health committee, had already been working on a bipartisan plan to make these fixes. That work got set aside as McConnell agreed to allow Sens. Lindsey O. Graham (R-S.C.) and Bill Cassidy (R-La.) to make a final push on their plan to fully repeal Obamacare.

In the wake of McCain's announcement, some Republicans began saying there was no point in even holding the vote on the Cassidy-Graham plan. "I'll be honest: It seems unlikely that we'll be voting on this," Sen. Joni Ernst (R-Iowa) said at a town hall Friday in Iowa City, adding that she believed a bipartisan route was needed.

"I hope that Lamar and Patty can come back again together, hopefully next week," Ernst said.

But that plan has already been panned by many conservatives as a bailout for the insurance industry, akin to the Wall Street bailout following the 2008 collapse of the economy. Opposition to that Wall Street bill was one of the main engines that launched the tea party movement and shifted the Republican Party ideologically to the right.

Taking over McConnell's weekly news conference Tuesday, Graham declared that Trump and Ryan had already declared their opposition to the bipartisan health-care effort and that it was left for dead.

"Here's what the speaker of the House told me: I will not bring up a bill or a vote in the House that props up Obamacare, because that is not why I came here," Graham told reporters.

Conservatives will be disappointed to see the ACA remain the law of the land — and could continue to oppose efforts to fix it. But GOP strategists fear that voters could blame Republicans for unstable insurance markets and soaring premiums now that they hold the White House and Congress.

When senators cast their last votes Tuesday, an abbreviated week because of the Jewish holidays, McConnell's team saw an outside chance at a double-barreled victory in the coming week.

Before he headed to Alabama, Trump's main selling points had been Strange's loyalty to his agenda, and in the final days of this heated campaign, Moore made clear he opposed the latest effort to repeal the ACA because it was not conservative enough.

The stage seemed set for Trump, as well as Vice President Pence, who is scheduled to arrive in Alabama on Monday, to sell Strange to the state's conservatives. Instead, Trump voiced doubt about his decision to back the sitting senator.

"I'll be honest, I might have made a mistake," Trump told the crowd in Huntsville at one point during his more than 30 minutes of remarks meant to bolster Strange's chances.

It was exactly the kind of encouragement that conservatives might be looking for to vote for Moore — and to challenge even more establishment figures next year.

It's a toxic recipe that could leave McConnell more wounded than ever by Friday.

Read more from Paul Kane's archive, follow him on Twitter or subscribe to his updates on Facebook.