SIOUX FALLS, S.D. (KELO) — District 26 Senate candidate Joel Koskan will not be heading to Pierre this January.

The Wood, South Dakota, Republican lost his race to Democrat Shawn Bordeaux according to the election results from the Secretary of State.

The loss comes just one day after Koskan appeared in court where a plea agreement was proposed by the Deputy Attorney General and Koskan’s counsel.

The deal, which still needs to be approved by a judge, would keep Koskan out of prison after pleading guilty to a class 4 felony of Exposing a Minor to Foreseeable Harm.

Koskan is accused of sexual grooming behaviors and a probable cause statement said that “probable cause exists to show” that he committed rape, aggravated incest, and sexual contact with a child under the age of 16.