President Donald Trump and Senate Majority Leader Mitch McConnell narrowly avoided deepening their rift on Tuesday night, as the pair’s preferred candidate for the Alabama Republican Senate primary advanced to the runoff.

Both Trump and McConnell threw their support behind Sen. Luther Strange, who finished a distant second to Roy Moore, the controversial former chief justice of the Alabama Supreme Court who maintains a core following in the deep-red state.

Moore led the crowded field of 10 candidates with about 40 percent of the vote. Strange, the incumbent who was appointed to fill Jeff Sessions’ seat after he was chosen to be Trump’s attorney general, slid into second place with about 32 percent, edging out conservative firebrand Rep. Mo Brooks.

Had Moore won more than 50 percent of the vote, a runoff would have been avoided. Had Strange finished behind Brooks in third place, he wouldn't have made the runoff. Neither of those things happened, leaving Trump unlikely to find a new opportunity to further disparage McConnell for having backed a losing candidate—for now.

That could all change if Strange can’t muster enough support to defeat Moore in the Sept. 26 runoff.

Trump endorsed Strange, viewed by many in the state as the establishment choice, a week before Election Day and recorded a robo-call on his behalf. The Senate Leadership Fund, a McConnell-backed super PAC, has poured millions of dollars into the state in support of Strange.

It was a rare instance lately where Trump and McConnell were on the same page. McConnell has been critical of Trump for his “excessive expectations” of how the legislative process works, and Trump has hit back against the majority leader, suggesting that he should step down if he doesn’t deliver on Trump’s top agenda items.

“Trump’s and McConnell’s interests are aligned, at least in this one case,” Matt Mackowiak, a Republican strategist and former Senate staffer, told The Daily Beast. “The Trump-McConnell partnership dodged a bullet tonight.”

Trump’s decision to back Strange incensed conservative activists inside and outside of the state. Although the race has been described bluntly as a Trump lovefest, allies of both Moore and Brooks suggested that Trump caved to the establishment—or the D.C. “swamp”—in siding with the McConnell-backed candidate.

Influential conservative media figures including Sean Hannity, Laura Ingraham, Ann Coulter, and Mark Levin backed Brooks, who has run an anti-establishment, anti-McConnell campaign. But it wasn’t enough to propel him to the runoff.

Had Brooks taken the second-place spot, the Alabama result could give the president yet another reason to ramp up his criticisms against the Senate majority leader—namely, Trump’s decision to throw his already diminished political weight behind a losing candidate. But Trump’s endorsement had a significant effect in the deep-red state where he defeated Hillary Clinton by nearly 30 points. By endorsing Strange, Trump prevented a last-minute surge in momentum that Brooks was trying desperately to build, with the help of his conservative media boosters.

“I think President Trump went to bat for Luther Strange, and I think he hit a home run—at least, maybe a triple. He should definitely take a victory lap,” Scott Stone, a veteran Alabama Republican campaign strategist not affiliated with any of the campaigns, told The Daily Beast.

Moore’s success on Tuesday was driven in part by a low GOP turnout—estimated at between 20 and 25 percent—which hurt both Brooks and Strange because Moore’s enthusiastic base was expected to turn out for him in droves in rural parts of the state.

Moore has stirred up controversy throughout his career, often garnering national attention. In 2003, Moore was removed from office after he refused to take down a Ten Commandments monument outside a court building. Last year, Moore was suspended for refusing to comply with the Supreme Court’s 2015 ruling that legalized same-sex marriage nationwide.

Despite Strange finishing 10 points behind Moore, Republican activists in the state believe Strange will be competitive in the runoff because he has a better chance of growing his voter base. Moreover, Moore has a high floor and a low ceiling and fewer national political influencers on his side that could help propel him to 50 percent. Many GOP voters who sat out the primary are expected to show up to the polls next month to stymie Moore’s chances of expanding his already-enthusiastic pool of voters.

“I think Luther Strange will certainly be very competitive in the runoff. I think they are where they want to be coming out of tonight. Either candidate could win at this point,” Stone said.

It remains to be seen whether Trump will get more personally involved in a competitive Republican race where, barring a miracle for Democrats, the GOP nominee will almost certainly win the general election.

“The question will be, will Trump even want to support someone who finishes second? What will persuade him?” Mackowiak said bluntly. “The Alabama Senate race, on the list of concerns Trump has on his plate as president of the United States, is relatively low on the list. And in a state like Alabama, it’s more about which shade of red you personally prefer.”