RAPID CITY - A former South Dakota teacher who pleaded guilty to having sex with a 15-year-old student is headed to prison.

Circuit Judge Janine Kern on Monday sentenced 26-year-old Kyle Keegan, of Rapid City, to seven years in prison, with four years suspended.

Keegan must serve at least 18 months of the sentence.

Defense attorney Tim Rensch tells KOTA-TV that Keegan expressed deep remorse for his actions, but believes the ruling is fair.

Keegan, who taught social studies and was a guidance counselor at New Underwood High School, pleaded guilty in January to sexual contact with a child under 16.

Keegan was arrested in October.

Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.