Former Massey Energy CEO Don Blankenship, Republican U.S. Senate candidate from West Virginia, speaks during an election night event in Charleston, West Virginia, U.S., on Tuesday, May 8, 2018.

Republican leaders have avoided their worst fear in West Virginia.

Trailing his two rivals Tuesday night, ex-convict Don Blankenship conceded in the West Virginia Republican Senate primary. State Attorney General Patrick Morrisey is projected to beat Rep. Evan Jenkins for the nomination, according to NBC News.

Blankenship's defeat allows Republicans to feel confident about their ability to flip a seat in the state President Donald Trump won by about 40 percentage points in 2016. The GOP felt either Jenkins or Morrisey had a better chance of winning statewide than Blankenship did.

Flipping Democratic Sen. Joe Manchin's seat would help Republicans to keep or expand their current 51-seat to 49-seat majority in the Senate. They hoped to avoid a situation similar to what they endured in deep-red Alabama last year. Ex-judge Roy Moore won the GOP primary but lost the special election to Democratic Sen. Doug Jones following accusations that he sexually abused teenagers decades ago.

Blankenship, the former Massey Energy CEO who served prison time for his role in a mine explosion that killed 29 people, ran a campaign replete with attacks on Senate Majority Leader Mitch McConnell. He earned the ire of the Kentucky Republican's allies with racially charged ads dubbing him "Cocaine Mitch" and alleging he created jobs for "China people" and profited off his "China family."

Those attacks related to a shipping company owned by the family of Transportation Secretary Elaine Chao, McConnell's wife, who was born in Taiwan. Earlier Tuesday, McConnell would not comment on the ads and said he would have more to say if Blankenship won the primary.

On Tuesday night, the Senate majority leader's allies gleefully cheered Blankenship's concession. McConnell's campaign tweeted a picture of the senator surrounded by a white powder with the message, "Thanks for playing, Don."

Team Mitch tweet

Steven Law, president and CEO of the McConnell-linked Senate Leadership Fund, said Blankenship "played the race card and West Virginia Republicans flipped it back in his face."

In the days leading up to the election, McConnell reportedly answered his phone as "Cocaine Mitch." He also encouraged Trump to denounce Blankenship. The president did so in a Monday tweet urging voters to reject him in favor of Morrisey or Jenkins.

In conceding Tuesday, Blankenship said Trump's tweet contributed to his loss.

Morrisey, 50, has served as West Virginia's attorney general since 2013 and touts his role in challenging Obama-era environmental regulations. He has cast himself as a conservative unafraid to stand up to establishment party leaders. Morrisey received endorsements from two GOP senators who have also tried to cultivate that brand: Rand Paul of Kentucky and Ted Cruz of Texas.

The attorney general has portrayed himself as a Washington outsider, in one ad showing a West Virginia mountain dropping on the nation's capital. But his past as a Washington lobbyist has diminished the imagery.

In a statement Tuesday, Democratic Senatorial Campaign Committee spokesman David Bergstein argued Morrisey "emerges tonight badly bruised from a bizarre primary contest that focused on personal political attacks instead of West Virginians." He also highlighted Morrisey's past as a lobbyist.

Facing a difficult re-election bid, Manchin has had to tread carefully around Trump while opposing some of his signature policies. The senator opposed both the Republican health-care and tax plans. Last month, Trump hammered Manchin for doing so.

Manchin has employed a strategy many Democrats trying to win in red, rural regions appear set to use: agree with Trump on some areas, but pledge to protect retirement and health-care benefits, and fight the opioid epidemic.