A 21-year-old man is believed to have become the first person in the UK to be jailed for posting revenge porn online.

Luke King was given a 12-week sentence after pleading guilty to harassment without violence. He had published intimate images of a woman on the WhatsApp messaging service in August after making a series of threats to her, Southern Derbyshire magistrates court heard.

King, of Aspley, Nottingham, was also issued with a restraining order, preventing him from contacting the woman. The Crown Prosecution Service (CPS) said the case was a reminder that such offences would be taken seriously.

The east Midlands branch of the CPS, its district crown prosecutor, Peter Shergill, described the offence as vindictive, adding: “Prosecutors are now following guidance issued in October that clarifies how we can use existing legislation to prosecute perpetrators of these intrusive offences.

“In this instance, because Luke King had threatened his victim and posted multiple pictures of her on social media, a charge of harassment was brought. He pleaded guilty to the offence and has been imprisoned and the victim now has the reassurance of a restraining order that will prevent any further contact from King.

“This is the first case of its kind in Derbyshire since the new guidelines came into effect and is a sharp reminder that these offences will be taken seriously and we will use a range of legislation to secure justice for its victims.”

A spokesman for Derbyshire police said: “It’s important for people to realise that it is an offence to harass others in this way. We agree with the judge that it was a despicable thing to do, especially after Luke King received warnings to stop. Anyone who is subjected to this type of crime should keep the evidence and contact the police as soon as possible.”