Democratic State Sen. Laura Kelly has beat Republican Secretary of State Kris Kobach, Fox News projects, flipping the governor's mansion in a deep red state that voted for Trump by more than 20 points.

The win will give Kansas Democrats a say in drawing new district lines in the state after the 2020 census.

Kobach ran as an anti-establishment outsider and Trump backer. His signature issues included strict immigration policies and preventing voter fraud. Kobach had also led President Trump's short-lived "Presidential Commission on Election Integrity."

But he was hurt by a close primary fight with Republican Gov. Jeff Colyer, as well as by several prominent state Republicans who endorsed Kelly. A general perception that former Republican Gov. Sam Brownback mismanaged state finances also weighed on Kobach. His Republican detractors hinted at that history during the campaign.

“After eight years of crisis, we cannot elect someone who wants to repeat the disasters of the past,” Former Republican Gov. Mike Hayden, who led Kansas from 1987 to 1991, had said. “Kris Kobach has promised to do just that – risking the future of our great state.”

Kelly, on the other hand, ran on a promise to be an “education governor." She also pledged to spend more on early childhood development programs, and to oppose restrictions on abortion.