MOUNT CLEMENS (WWJ/AP) – A former metro Detroit high school basketball coach who authorities say had sex with a 16-year-old student has been sentenced to six months in jail.

Twenty-four-year-old Derek Knoll learned his punishment on Thursday in Macomb County Circuit Court. Knoll in September pleaded no contest to four counts of second-degree criminal sexual conduct in an agreement with prosecutors that allows him to avoid time in a state prison.

READ MORE: Belle Isle Park Reopens Giant Slide Friday

The sentence also includes $33,000 in restitution to pay for the student’s therapy, six months of house arrest and five years of probation.

Defense lawyer Mike Dennis earlier tried to get the case dismissed. He questioned the therapy payments and plans to challenge them.

READ MORE: Woodward Dream Cruise Kicks Off This Weekend: What To Know

Knoll was the freshman basketball coach at Warren Woods-Tower High School in Warren when the misconduct occurred. After the two began chatting via Twitter, a sexual relationship developed last December, according to police. Prosecutors say the two had sexual contact at least 15 times at Knoll’s apartment and his parents’ home.

Detectives say the case came to light as they investigated and did interviews in another case involving Dale Malesh, a retired cop and school resource officer who was charged with having sex with a different 16-year-old student. Police said that’s when said an anonymous student tipped off school authorities.

Knoll worked as a volunteer at the school for the past seven years before being hired to coach football and baseball. He resigned in April.

MORE NEWS: Federal Judge Retains Jurisdiction In Lawsuit Over Enbridge Pipeline

TM and © Copyright 2013 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2013 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.