Senate Majority Leader Mitch McConnell faces a potential serious headache in Kansas if the state’s former secretary of state and GOP gubernatorial nominee Kris Kobach is not selected to lead the Department of Homeland Security (DHS) in the wake of Secretary Kirstjen Nielsen leaving the job.

Kobach has made clear to a number of allies and stated publicly that he intends to run for the U.S. Senate seat that retiring Sen. Pat Roberts (R-KS) is vacating next year, and polling conducted on the potential primary race Kansas insiders shared with Breitbart News puts Kobach with sizable leads ahead of other potential candidates, such as Rep. Roger Marshall (R-KS) or American Conservative Union (ACU) chairman Matt Schlapp.

Kobach, an immigration hardliner and top ally of President Donald Trump, was in consideration previously for a thus-far-uncreated “immigration czar” position. That position may still come to be, but given Nielsen’s departure from DHS, Kobach has emerged as one of a list of potential contenders for the Senate-confirmed DHS secretary position.

Kobach ran unsuccessfully last year for governor in Kansas, winning the GOP nomination in a close hard-fought battle with Trump’s backing, but he then lost the general election to Democrat Laura Kelly.

After announcing Nielsen’s departure from the DHS secretary position, President Trump installed U.S. Customs and Border Protection Commissioner Kevin McAleenan as the new acting DHS secretary for now–buying himself some time to make a decision on who will replace Nielsen full-time. Trump will undoubtedly consult McConnell on this, and the Senate Majority Leader could easily head off a bloody political primary in Kansas if he backed Kobach for the job.

Some in the establishment wing of the GOP may try to argue that Kobach would have issues with securing a majority in the GOP-controlled Senate, but with McConnell’s backing, Kobach would likely not have issues getting across the finish line to confirmation. Other GOP senators who frequently spar with Trump on immigration, such as former Massachusetts Gov. Mitt Romney–who now represents Utah in the Senate–are likely to back him, given that Kobach backed Romney’s 2012 presidential campaign. McConnell could shore up almost everyone else except Sens. Susan Collins (R-ME) and Lisa Murkowski (R-AK), perennial problems for the GOP no matter what is being voted on in the Senate.

But with 53 senators in the GOP majority, and Vice President Mike Pence standing by to cut any ties, the GOP can afford to lose Murkowski and Collins without any impact on the final outcome. Democrats like Sens. Joe Manchin (D-WV), who is considering a run for governor in West Virginia, and Doug Jones (D-AL), who faces a tough re-election fight in deep-red Alabama in 2020 with Trump at the top of the ticket for Republicans, would undoubtedly face enormous pressure to vote for Kobach should he get nominated.

No matter who Trump nominates, Democrats and the hard-left are likely to make it a flash-in-the-pan proxy war over immigration. That leaves some immigration hardliners and close allies of Trump wondering why the president should not go big and bold, like he did when selecting Brett Kavanaugh over Raymond Kethledge for the U.S. Supreme Court last year in what became one of the biggest culture wars of the year, by picking Kobach as a battle buddy on the issue.

But if Trump goes a different direction, McConnell could be in for more bloody intra-GOP warfare in Kansas. Kobach has been gearing up to run for the Senate seat that Roberts is leaving and, apparently, ready to pull the trigger soon. If he became DHS secretary, though, those Senate run plans would likely go by the wayside–and McConnell would likely be able to get a more pliable GOP nominee in a Marshall or a Schlapp or someone like them. If Kobach does run for the Senate, given that current private polling has him ahead of potential other candidates, it could get very messy for the GOP in the primary–and if Kobach emerges victorious, as he did in the governor’s race last year, it could set up a general election battle with Democrats in a deep-red state that the GOP rightly thinks should not be competitive in the general election.

With precious few opportunities for picking up more Senate seats from Democrats in just Alabama, New Hampshire, and Michigan in 2020–far fewer opportunities than the 2018 midterms–and many seats in Colorado, Maine, and more to defend, the GOP is likely to want to avert anything that could throw the Kansas race into the mix in November.