JERUSALEM — A video of a barely visible man having sex with his all-too-visible ex-girlfriend has inspired a new law in Israel that makes posting sexual pictures or videos to the internet without the permission of those featured a sex crime.

The video, which garnered tens of thousands of views within days of being posted to WhatsApp, a hugely popular app in Israel, a few months ago, drew the ire of women's groups in Israel. It also incensed lawmaker Yifat Kariv, who is currently serving her first term in Israel's parliament after being elected on a platform of advancing women's issues.

"These days, we see more and more cases of sexual assault that are documented and distributed to the public without limits. This legislative intervention is necessary and will help combat the shocking phenomenon of 'virtual rape,'" Kariv told the Jerusalem Post.

Kariv said revenge porn had become all too common, with young men hoping to punish sexual partners by humiliating them online.

The law was approved in a third, and final, vote in Israel's parliament on Monday evening unanimously by the 31 lawmakers present. It punishes anyone who creates a sexual film or photographs without the subject's consent or awareness and posts it online without that person's explicit consent. Those who break it become registered sex offenders, and could serve up to five years in prison.

"It is clear to us that the pace of legislation always lags behind the technical and virtual reality in which we live. This is a law that is a breakthrough both from the legislative standpoint and also from the normative and ethical standpoint. This is a great achievement for the victims of sex crimes," Kariv told Haaretz.

Revenge porn has increasingly become a problem across the world, and few countries have begun to address it. Several months ago, a state in southeast Australia passed new legislation that makes it illegal to distribute explicit images without a persons consent, and several states in the U.S. are in the process of passing similar laws.

Bills criminalizing revenge porn have recently been introduced in Wisconsin, New York, and Maryland, and have already been passed in California and New Jersey. But the California legislation doesn't cover self-taken shots, which some campaigners claim may represent up to 80% of all revenge porn.