Maybe there is actually something right with Kansas. On Tuesday, Democrats in the traditionally conservative state trounced the Republican candidate Kris Kobach in the race for governor, providing a potential playbook for how Trumpism can be defeated. Whether the Kansas example applies to Democrats elsewhere remains to be seen, but no midterm candidate was more Trumplike than Kobach, and his defeat suggests that Trumpism—if not Trump himself—has vulnerabilities.

“I think there’s probably a lesson,” Kathleen Sebelius, a former Democratic governor of the state, who also served as the Secretary of Health and Human Services under Barack Obama, told me. Sebelius, who helped recruit the winning candidate in this year’s gubernatorial race, the former state senator Laura Kelly, suggested that among the most effective strategies was the Kansas Democrats’ success in convincing former Republican office-holders to publicly oppose Kobach. By the end of the campaign, Kelly had been endorsed by two former Republican governors, the former Republican U.S. senator Nancy Kassebaum, and a slate of some forty former and current Republican state legislators. Unlike Republicans in Congress, many of whom have kept silent about their disapproval of Trump, Sebelius said, “Republicans in Kansas who didn’t like the direction that the Party was going in didn’t keep quiet.” She noted that “you could not have found a more Trumpian candidate” than Kobach, “and, for a lot of folks, it was a bridge too far.”

The journalist Thomas Frank, the author of “What’s the Matter with Kansas?,” the breakthrough study, from 2004, on the rise of conservative, anti-élitist populism in the state, said in an interview that “Kobach did everything he possibly could to associate himself with Trump.” He stumped in a Jeep decked out with a model of a machine gun on the roof, and adopted as his campaign slogan the phrase “Make Kansas Great Again.” Frank, who grew up in Kansas, knew Kobach when they were both high-school debaters, and suggested that, despite the heavy-handed theatrics of his former debate opponent, it would be a mistake to underestimate him. He regards Kobach, who went on, after high school, to attend Harvard, Oxford, and Yale Law School, as “likable, very intelligent, and pretty ruthless—or, at least, determined.”

The 2018 Midterms Read all of The New Yorker’s election reporting and commentary.

In his gubernatorial run, Kobach tried, if anything, to be more Trumpian than Trump. As Burdett Loomis, a political-science professor at the University of Kansas, put it in a phone interview, “Stylistically, he took many pages from the Trump playbook. In fact, he doubled down on Trump.” Kobach wrote a column for Breitbart News, the most Trump-aligned of media outlets, and unabashedly fanned the same nativist fears that the President stokes, darkly warning that Americans’ jobs and elections were gravely threatened by hordes of illegal immigrants.

In the name of cracking down on voter fraud, a phenomenon that nonpartisan experts say is virtually nonexistent, Kobach, as secretary of state, blocked some thirty-five thousand Kansans from registering to vote between 2013 and 2016. Ultimately, nine people were convicted as a result of his voter-fraud dragnet, mostly older folks who were confused by the voting rules. Kobach went to court four times to defend the draconian voter-identification rules he tried to impose, and lost each time. His attempt to represent himself in his most recent court battle against the American Civil Liberties Union was so disastrous that the judge not only struck down the law at hand but held Kobach in contempt, ordering him to take six hours of remedial tutoring on the rules of civil procedure. Ultimately, it became clear that Kansas’s most serious electoral issue wasn’t fraud but, rather, malfunctioning voting machines, which had been purchased under Kobach.

After the 2016 election, however, Kobach caught Trump’s eye and won his favor by promoting the President’s baseless claim that the only reason Trump had lost the popular vote to Hillary Clinton was that illegal immigrants had cast fraudulent votes and other people had voted twice. Kobach cultivated Trump, who, in turn, gave him a national platform, inviting Kobach to advise the Presidential transition team on immigration issues and making him the vice-chairman of a national commission on voter fraud. The commission disbanded in disrepute after becoming stymied by in-fighting and the failure to find any significant fraud, but it nonetheless helped to make Kobach a rising conservative star.

As Kobach echoed Trump’s rallying cries in his gubernatorial race, Kansas became a kind of state-level litmus test for Trump’s politics of fear. Until last week, the polls suggested that the race between Kobach and Kelly was too close to call. A wild card was a third-party candidate, the businessman Greg Orman, who ran as an Independent and threatened to play the spoiler role by siphoning off disgruntled centrist voters who might otherwise have backed Kelly.

But, to the surprise of many, on Tuesday, Kelly decisively defeated Kobach, capturing approximately forty-eight per cent of the statewide vote and leaving him with just forty-three per cent. Kelly’s winning formula, it appears, was to ignore provocative bait and focus on proverbial “kitchen table” issues that had nothing to do with Trump. Instead of engaging with Trumpist tropes about immigration and voter fraud, or on the issue of Trump himself, she studiously focussed on education, Medicaid expansion, and the woeful fiscal condition that the state had been left in by its unpopular former governor, the Republican Sam Brownback. Loomis noted that, although “Kobach talked about Trump, I’m not sure I ever heard Kelly talk about Trump. She was a really good foil for Kobach, who was so blustery. He never affected her much. If there’s a national message,” he said, “it’s that there are limits to how crazy you can go doubling down on Trump.”

Sebelius suggested that the prospect of Kobach doubling down on Trump’s policies in the state was “terrifying” not just to Democrats but also to enough Independents and Republicans to win the day for Kelly. Her victory also suggests that it is possible to impose a reality check on the far-right libertarian theories espoused by Brownback and his financial sponsors, the billionaire oil barons Charles and David Koch, who are also from Kansas. Kobach was seen by many voters as a clone of Brownback, who had promoted the supply-side economic shibboleth that, by drastically cutting taxes, Kansas would thrive. When the opposite proved true, and the state’s vital services became desperately underfunded, voters rebelled. In 2017, a bipartisan majority in the state’s legislature passed a major tax increase over Brownback’s veto. Sebelius noted that the tax cut passed by Brownback “was the mirror of what was just passed by Congress. People didn’t think it was fair.”

Kobach’s candidacy, in which he embraced many of the same fiscal policies as Brownback, was seen by many voters as a referendum on the past governor. “Voters thought Kobach would do much of the same,” Loomis said. “And, particularly in the Kansas City suburbs, moderate Republican and unaffiliated women said, basically, ‘This isn’t going to happen.’ ”

Jim Slattery, a former Democratic congressman from Kansas, who served from 1983 to 1995, told me that Kobach lost, in part, because Kelly managed to frame the election as a referendum on Brownback’s conservative economic policies, rather than getting sidetracked by Trumpian fear-mongering. He said that Kelly was especially strong when she argued that Medicaid expansion would save rural hospitals—a case she made with the help of Republicans, including the state’s former Republican insurance commissioner, who recorded a powerful advertisement on her behalf. That, and Kelly’s championing of education funding, Slattery believes, made the difference. “People saw Kobach making a big deal about issues like voter fraud, but thought it was contrived,” he told me.