If you thought the Mississippi Republican primary for Senate would end when the runoff votes were counted, you were mistaken. The contest between Thad Cochran and Chris McDaniel has become the latest front in the civil war between the Republican establishment and the Tea Party.

Unfortunately, the race has highlighted the least attractive features of each faction.

Cochran was the incumbent Republican most vulnerable to a Tea Party challenge this year. He received fewer votes than McDaniel in the first round of balloting and was widely expected to lose in the runoff. He had to massively increase turnout from his own base and win over black voters to prevail.

If that was all that happened, Cochran’s come-from-behind victory would be a massive triumph of get-out-the-vote operations and minority outreach that could serve as a model for future Republican candidates.

Except that at least some of that turnout was boosted by racially incendiary ads amplifying Democratic talking points against conservatives. The radio spots purported to tie McDaniel to the Ku Klux Klan, accused him of having a “racist agenda,” and warned that Mississippi blacks “could lose food stamps, housing assistance, student loans, early breakfast and lunch programs and disaster assistance.”

“Vote against the Tea Party,” one ad said. “Vote Thad Cochran. If the Tea Party, with their racist ideas, win, we will be sent back to the ’50s and ’60s.”

In short, the ads combine Mitt Romney’s complaint that Democratic voters want “gifts” from the federal government with Joe Biden’s assertion to a black audience that Romney was going to “put you all back in chains”—the latter a bit of race-baiting so silly it was mocked by Charlie Rangel, a Harlem Democrat who is no stranger to hard-edged racial politics.

A number of reports have tied the ads to a political action committee founded by Haley Barbour, a lobbyist who served as governor of Mississippi and chairman of the Republican National Committee. The PAC is currently run by his nephew, Henry Barbour.

Thus the ugly tactics bore the imprimatur of the Republican establishment.

Former Washington Times editor Wesley Pruden wrote that Cochran “will likely disappoint everyone but the lobbyists who used race and resentment to aid his escape from oblivion.”

Before this, the race’s most shameful episode was when a McDaniel supporter sneaked into a nursing home to videotape Cochran’s bedridden, ailing wife. Though strongly disavowed by the McDaniel campaign, the apparent motivation was to sharpen allegations that the senator was having an extramarital affair with a female staffer.

That bizarre chapter ended in tragedy Friday, when Mark Mayfield—a Tea Party leader and lawyer facing charges as a result of the videotaping incident—died in an apparent suicide.

It is unclear how much either candidate knew about the mud being slung in their names, but they were both revealing examples of the GOP factions they represented. McDaniel, like many Tea Partiers, was a flawed candidate running on a good platform with endorsements from figures like Ron Paul.

Cochran was an incumbent who stayed too long—apparently even for his own tastes, as he was once heavily leaning toward retirement—and despite a generally conservative voting record, he accomplished relatively little for the Republican right.

The aftermath of the campaign has given both camps an opportunity to put their worst foot forward. The Republican establishment is once again seen disdaining the conservatives who volunteer for their campaigns, vote them into office, and even fight in their wars as unsophisticated rubes whose bigotry must never be too close to the levers of power.

On the other side is Tea Partiers practicing politics as a form of primal scream therapy, engaging in protests with a low probability of success and a potential to do damage to their own cause. Their anger is directed not only against Cochran, whom some of them will vote against in November, but Republican leaders like Mitch McConnell and John Boehner.

For every party organ that backed Cochran to avoid spending money on the Mississippi Senate race this fall and every party leader who crowed about crushing conservative primary challengers is now a suspect in the anti-McDaniel race-baiting caper.

Will this anger dissipate as the midterm elections approach if Republicans are within striking distance of a Senate majority? Perhaps. Sending Harry Reid back down to the minor leagues will likely be a bigger Tea Party priority than retiring McConnell. But elephants never forget.

W. James Antle III is editor of the Daily Caller News Foundation and author of Devouring Freedom: Can Big Government Ever Be Stopped?