A primary school teacher who hijacked a girl's Twitter account to post revenge porn has been jailed for 18 months.

Samuel Alexander posted the "extremely intimate" photo online after trying to blackmail his victim into sending him further images and videos of a sexual nature she had taken of herself, Amersham Crown Court heard.

The 24-year-old had had "an unhealthy sexual interest" in the girl over a five year period, beginning when she was just 15, the court was told.

Andrew Morgan, prosecuting, told the court Alexander, of North Dean, Speen, had attempted to see the girl getting undressed through a keyhole "on numerous occasions" and would "take opportunities to feel her breasts over her clothing".

He then took to blackmailing the girl, who cannot be named for legal reasons, after discovering photos of her on her laptop.

Mr Morgan said: "The defendant managed to find a series of images she had taken of herself, aged around 17. These images were of an explicit nature and were not intended for wider distribution - they were for her current boyfriend, she had never intended to share them with anyone else.

"The defendant, now in possession of the images, seeks to pursue her to provide further images. It's a threat of revelation."

The court heard Alexander then found more images and a film the girl had taken on an iPad, which he then, Mr Morgan said, went on to steal for himself.

Mr Morgan said Alexander then demanded his victim send more images of herself, threatening to make them public if she did not comply.

She sent photos to him and received a £150 payment. Mr Morgan said: "She believed if she complied, he would desist [from making demands]."

A year later he made further threats - but on this occasion, when the girl did not comply, Alexander hacked her Twitter account and posted a sexually explicit image of her, the court heard. The girl then went to the police, who arrested Alexander.

Alexander had previously pleaded guilty to two counts of sexual assault, two of blackmail and one each of attempted voyeurism and distributing an indecent image of a child at an earlier court hearing.

He was jailed for a total of 18 months by Judge Karen Holt, who also ordered him to sign the Sex Offenders' Register for the next seven years.

Judge Holt said: "It's quite clear to me you developed an extremely unhealthy obsession with your victim. There was a course of conduct that culminated in these criminal offences.

"Your behaviour, regrettably, developed. You found some digital images she had taken - as she was perfectly entitles to do so, them being private images between her and her partner. They were of an explicit nature. You stole those images, then started a course of conduct which was extremely unpleasant and extremely worrying."

She described one of the photos he posted online as "an extremely intimate picture" that he "put on for all to see".

Judge Holt added: "She still felt under threat of revelation. The impact of your behaviour is still on her."

Alexander is also barred from contacting his victim for the next two years.