Republican Roger Pine was the apparent winner in the 3rd District Kansas Senate race Tuesday, defeating Democrat Jan Justice.
With some precincts' many advance ballots still uncounted early Wednesday, Pine was leading by a margin of several percentage points.
Pine said the close nature of the race was a concern from the beginning.
"I was cautiously optimistic," he said. "It looked like I had a good chance, but that's as far as I wanted to go until I had hard numbers."
Justice would not concede at midnight Tuesday, citing incomplete precinct results and uncounted absentee ballots.
Pine, 64, is a longtime Lawrence-area farmer. He previously served two terms on the Lawrence school board and was appointed to various Douglas County governing boards.
Justice, 55, Bonner Springs, is executive director of Community Linc and had served on her rural water district board.
Both candidates ran on platforms promoting economic development, capping property taxes and supporting public schools.
But they diverged on social issues: Pine is anti-abortion, Justice advocates abortion rights. Pine also favors a statewide vote on a state constitutional amendment banning gay marriage; Justice said she would support such a measure, but also said it was unneeded in light of Kansas laws already prohibiting the practice.
Pine said the next step for him was to learn more about the issues facing the Legislature, especially education finance.
"I'll also learn about my responsibilities and duties and prepare myself for those tasks," he said. "And I want to become better acquainted with the leadership in the Senate."
Pine replaces outgoing Sen. Bob Lyon, a Republican.
The district includes a portion of Lawrence north of Sixth Street, plus Baldwin, Eudora, all of Jefferson County and Basehor, Easton, Linwood and Tonganoxie in Leavenworth County.
-- Kansas University journalism student Jodie Krafft contributed to this report.