A "peeping Tom" music teacher has been jailed for having sex with one pupil and taking naked pictures of another.
Simon Pinnington, 32, of Magnolia Court, Cheltenham, admitted two counts of sexual activity while in a position of trust at a school in the town.
Police were called after his text messages were found on a girl's phone.
Pinnington was jailed for three years, including a 21-month extended licence period, and ordered to register as a sex offender for 10 years.
Gloucester Crown Court heard Pinnington had sex with one of the girls at his home.
He also admitted watching another girl perform a strip over his webcam and saving the pictures onto his computer.
Pinnington, a former choirmaster, also pleaded guilty to setting up a secret camera to film a 23-year-old woman in a spa bath at his home.
The court was told he communicated with the girls using text messages and internet chat rooms but was caught when one of the girls' sisters saw a message from him.
The offences took place between March 2004 and January 2005.
Judge Jamie Tabor QC told Pinnington he had taken advantage of the girl he filmed over his computer webcam and called him a "peeping Tom".
"She may well have agreed to it, but she should not have been put in that position," he said.
He told Pinnington he should have "resisted the temptation" to have sex with the other girl, saying: "You were a married man and twice her age."