The 31-year-old man who turned himself in to police after attacking a high school girl will spend the next three years in prison.

Daniel Phillip Rief grabbed the 15-year-old girl and knocked her to the ground of her Nepean High School bathroom the morning of March 31.

Rief told the court he was looking for drugs, not sex.

The girl was not assaulted sexually.

Rief was arrested in June, nearly three months after the attack happened.

At the time, investigators told CTV Rief was known to police but would not specify for what reasons.