Posting "revenge porn" images and videos on the internet is becoming a criminal offence in England and Wales.
The Criminal Justice and Courts Bill, which has a specific amendment dealing with such actions, will receive Royal Assent and become law later. Offenders face up to two years in jail.
The amendment covers images sent on social networks, including Facebook and Twitter, and those sent by text.
Both Scotland and Northern Ireland are considering similar laws.
The new English and Welsh law classes revenge porn as "photographs or films which show people engaged in sexual activity or depicted in a sexual way or with their genitals exposed, where what is shown would not usually be seen in public".
It covers images shared on and offline without the subject's permission and with the intent to cause harm. Physical distribution of images will also be covered.
The Scottish Government told BBC Newsbeat there were plans to consult on making revenge porn a specific offence.
Northern Ireland's Department for Justice said there were existing laws to prosecute revenge porn offenders, but ministers would consider the case for a new offence.
Victims of revenge porn have found it difficult to have pictures removed from the internet.
Many sites where the images are hosted are based outside the UK, and requests to remove content are often ignored.
In some cases, asking for removal results in more attention being brought to the images.
According to information from eight police forces in England and Wales that kept data on this issue, there were 149 allegations of revenge porn made between 1 January 2012 and 1 July 2014.
The vast majority of victims were women. Six incidents resulted in police action.
Without specific legislation, some have sought legal workarounds to have images taken down - most commonly the use of copyright law, since if an intimate picture has been taken as a "selfie", the image's copyright belongs to the taker.
Former culture secretary Maria Miller told BBC Radio 4's Today programme the law needed to change.
She said: "By putting this in place the government has given young women the opportunity to protect themselves from their lives being blighted.
"When you speak to the victims of these crimes, many say that it feels as if you've been virtually raped.
"You can't underestimate the impact of having an image distributed to many people around the world."
Barbora Bukovska, from the organisation Article 19, which defends freedom of expression, said criminal legislation would not solve this problem.
She said: "There is probably no need to introduce a new law as there is already enough legislation prohibiting this conduct."