Democratic candidate state senator Laura Kelly responds to questions on stage during the Gubernatorial debate at the Kansas State Fair in Hutchinson, Kansas, September 8, 2018.

Democratic state Sen. Laura Kelly will win the gubernatorial election against Kansas Secretary of State Kris Kobach, NBC News projects, just in time to have a hand in the upcoming redistricting battle that could shape control of the state for the next decade.

The race was in a dead heat days before the election, with Kobach either up by 1 point or in a tie with Kelly.