A former Chanhassen High School principal pleaded guilty Thursday to owning child pornography as part of a deal that will include a five-year prison sentence.

Timothy Dorway, 44, enter his guilty plea to seven counts of felony possession of child pornography in Carver County District Court. He was also sentenced to five years' probation after his release from prison. Sentencing is scheduled for July 26.

Dorway was charged in December after the state's Internet Crimes Against Children Task Force received a tip from the National Center for Missing and Exploited Children.

Dorway told investigators that he was primarily interested in pornography involving 11- to 13-year-old girls. Investigators found videos in Dorway's possession that involved girls and boys of much younger ages and found 127 videos and images total, according to the criminal complaints.

Dorway told authorities that he would receive Dropbox links of pornography from other people and would eventually delete the videos from his account. Investigators found 21 videos on his computer, according to the complaint.

He accessed his Dropbox account from an IP address registered to his home in Victoria and from an IP address owned by Eastern Carver County School District, according to the charges.

He was arrested Dec. 14. The district terminated his employment in January.

Dorway began teaching English, journalism and speech in 1995 at Park High School in Cottage Grove, where he worked until 2002. During that time, he also supervised yearbook, newspaper and speech students and coached football and baseball.

He went on to serve as Owatonna High School principal from July 2002 to June 2006. Dorway was employed by the Rochester School District from July 2007 to June 2010. Before moving to Chanhassen High School, he had been principal at Rochester Mayo High School.