President Donald Trump deliberately made this election about the alleged threat of immigration rather than his real accomplishments on the economy,

which, apparently, were just "boring" to him. He tried to sow fear and panic in the wee hours of the election about the migrant caravan—going so far as to call this the "election of the caravan." He claimed that the caravan was composed of criminals, and included Middle Eastern terrorists. He deployed 15,000 military troops on the Southern border, threatening to shoot them if they threw stones. He promised to scrap birthright citizenship by executive order. This was so over-the-top that House Speaker Paul Ryan called him and begged him to cool it and talk up the economy instead. To no avail. Trump responded by tweeting that Ryan "knew nothing about" birthright citizenship. Ryan called again and begged again and was ignored again.

So how did hardline Republicans who followed Trump's rather than Ryan's strategy do?

Not well, to put it mildly.

Iowa's Rep. Steve King, who out-Trumped Trump, won his re-election bid but just by a squeaker. FiveThirtyEight had put the odds of King, a shameless racist, keeping his seat at 80 percent for the simple reason that his district is overwhelmingly white and hardline Republican. He made headlines some months ago when he tweeted his support for far-right Dutch candidate Geert Wilders noting that Wilders was right in keeping out non-white immigrants because "you cannot rebuild your civilization with other people's babies." King endorsed white nationalist Faith Goldy for mayor of Toronto and gave an interview to Unzensuriert, a publication associated with Austria's Freedom Party, which was founded by a former Nazi SS officer and is now led by Heinz-Christian Strache, who was active in neo-Nazi circles as a youth. He had previously commented that undocumented Mexicans have "calves the size of cantaloupes because they're hauling 75 pounds of marijuana across the desert."

In the last few weeks, a la Trump, he'd taken to banning news outfits like the Des Moines Register and The Weekly Standard from his events because he didn't like their coverage.

All of this took toll on his final tally. In the past he'd won this district by double digits. This time? Less than three points!

His other ultra-restrictionist colleagues weren't so lucky.

The four most anti-immigration hardliners were: Kris Kobach (Kansas governorship), Corey Stewart (Virginia governorship), Dave Brat (U.S. House from Virginia) and Lou Barletta (U.S. Senate from Pennsylvania).

Stewart and Barletta never really had a shot. But Kobach and Brat's seats were winnable by the GOP had it fielded the right candidates in these largely conservative districts. Instead, they lost.

Kobach, the Kansas secretary of state, readers will recall, was the author of Arizona's notorious "Your Papers Please" law. Subsequently, as Matt Welch wrote, he tried to make a career out of chasing the non-existent problem of illegal immigrant voter fraud, even heading Trump's voter fraud commission before it was disbanded because of Kobach's rank incompetence.

Slate points out, he spent years promoting Crosscheck, a program that ostensibly detected double voting but actually had an error rate of 99.5 percent. He pushed a law that compelled Kansans to provide proof of citizenship in order to register to vote, then defended it himself at trial—at which point it became clear that he had zero understanding of the basic rules of civil procedure. A federal judge repeatedly reprimanded him during the hearings, then ruled against him and held him in contempt of court. Although a lawyer, he was ordered to take six hours of remedial legal classes. Kobach also built a lucrative legal practice talking cities into passing ordinances that punished landlords and employers who did business with undocumented immigrants, only to then lose in court when the laws were inevitably challenged.

All of his added up to a 4.5 points loss for him. (His career might be dead unless Trump, as per rumor, nominates him to replace Jeff Sessions as Attorney General. That, if nothing else, would make for joyous confirmation theater as Democrats publicize his record of mischief.)

Brat lost by a smaller 1.5 point margin. But the outcome was still stunning given that only four short years ago, Brat, a professor and a political neophyte, ousted House Majority Leader Eric Cantor in an upset victory largely by berating Cantor's support for comprehensive immigration reform. In this round, not only did Trump endorse him but Steve Bannon traveled to Virginia to stump for him. His opponent, Abigail Spanberger, however, made Brat's hardline position a major campaign issue, mobilizing suburban women against him in an open repudiation of his and Trump's anti-immigration agenda.

One last thing, some Republicans are suggesting that Trump's harsh immigration policies and rhetoric delivered for Ron DeSantis in the Florida gubernatorial race. DeSantis' opponent was Andrew Gillum, an arch progressive lefty, whose nomination everyone initially believed meant a sure-shot victory for DeSantis. After all, Republicans have won the governor's race in this state for the past 20 years. But DeSantis eked out a mere 0.7 point victory. Why? Because DeSantis' alignment with the president in a heavily Latino district was major liability. Had he not gone full-blown Trumpist and refused to distance himself from the president's excrescences on the caravan and birthright citizenship, there is a very good chance that he would have won by a far wider margin. Ditto for the Ted Cruz-Beto O' Rourke Texas senatorial race that Cruz won by a mere 1.5 points!

It is hard to see these results as anything other than a repudiation of Trump's hardline immigration nonsense. As Cato Institute's David Bier notes, the House is now the most pro-immigration it has been since at least the 19th century. The last time the Democrats controlled the House, they couldn't even get a majority of the House to support a very restrictive version of the Dream Act. This time, House Democrats are unified on providing a pathway to citizenship for Dreamers, legalization of long-time illegal residents, and doubling legal immigration, while permitting only moderate enforcement measures to be attached. There are no anti-immigration Democrats in the House now. In addition, a contingent of pro-immigration Republicans survived, and they would likely join any effort to improve the legal system.

So the question now is if Trump will get the message and start working with Democrats on sensible immigration reform sans his poison pills like demanding a 40 percent cut in legal immigration in exchange for legalization of Dreamers. Or keep doubling down on a bad bet and do to the Republican Party what he did to his casinos: Bankrupt it with his ill-advised gamble.