Persons who post so-called “revenge porn” in New York will soon be subject to criminal charges and civil litigation for sharing sexual photos or videos of someone without their consent after a bill outlawing the action was approved by the Legislature on Thursday.

Upon the bill's signing by Gov. Andrew Cuomo, New York would become the first state, according to lawmakers, to provide a specific mechanism for victims to seek a court-ordered injunction to have an image or video of a victim of revenge porn removed from a website.

After years of mixed results in the state Assembly, which is often wary of adding new crimes to the state's penal code, a final version of the bill gained bipartisan support in the chamber and across the way in the State Senate.

The bill has been sponsored for a number of years by Assemblyman Edward Braunstein, D-Queens, but this was the first year a Democrat also carried the legislation in the Senate. Sen. Monica Martinez, D-Suffolk, signed on to sponsor the legislation earlier this year after Democrats gained a majority in the upper chamber for the first time in nearly a decade.

“It is a despicable act that scorned partners would violate the trust of their partners by releasing intimate images in an act of retaliation,” Martinez said. “Our laws have yet to catch up with technology and the myriad of ways technology can be abused.”

The legislation is set to create a new crime of unlawful dissemination or publication of an intimate image, a class A misdemeanor. That level of crime can carry up to a year in jail, according to the state's penal code.

The bill has a specific definition of the crime, but someone would generally be subject to the charge if they intentionally share an image or video of a person without their consent to harm them that depicts them unclothed or in a sexual context.

Prosecutors who bring the charge will have to prove the alleged perpetrator's intent to cause harm to the victim's emotional, financial or physical welfare, according to the bill. They will also have to show the victim wanted the photo or video to remain private and that the person who distributed it either knew or reasonably should have known that.

Attorneys who helped craft and advocate for the legislation said proving intent may be a challenge for prosecutors in some cases where there isn't a lot of material to work with on a case. Senior staff attorney Lindsey Song of Sanctuary for Families, which partly provides legal services for victims of gender violence, said prosecutors and litigants can sometimes have access to corroborating information that make it easier to show intent.

“We do anticipate that an issue that will come up in prosecution but some of the time we do have images that are paired with text messages or other information,” Song said. “Alternate evidence is going to be very important, so text messages or when someone posts information on a website with [the victim's] information.”

Song said much of the same material would be used by litigants who seek to bring civil claims against an alleged distributor, whether that person was brought up on criminal charges or not.

The grounds for bringing a civil case against someone over allegations of revenge porn carry a different definition under the legislation. A plaintiff would have to show that an individual distributed an image or video of them unclothed or in a sexual context without their consent for the purpose of harassing, annoying or alarming them, according to the bill.

Braunstein said the bill will allow victims to bring civil claims against both an individual who shared an image or video without consent and the website it was posted on, if that happens.

The statute will also allow a plaintiff to ask for a court order to have such a photo or video removed from a website, if that's within the website's control. A court order could also be requested against an individual to stop them from sharing the content again.

That could be tricky for litigants who want to go after individuals in another state, but victims may be more likely to have an image removed from the internet, said Assemblyman Joseph Lentol, D-Brooklyn.

“The state has long-arm statutes that can reach people who do business in New York,” Lentol said.

Civil litigation would be allowed up to three years after an image or video of the victim is shared or posted online. But if the victim doesn't discover that an image or video of them has been shared until years later, they will have up to one year after that discovery to bring a lawsuit, according to the bill.

Carrie Goldberg, an attorney with her own firm in Brooklyn that focuses on privacy litigation, sexual abuse and other areas, said she's advocated for the legislation for years and helped write part of it. Her firm, which now has a staff of 15 attorneys, has acted to remove more than 20,000 images from the internet for victims, she said.

The new law keeps pace with other areas of the state's privacy law already used by attorneys and their clients to protect their personal information, Goldberg said.

“There are protections in criminal law for credit card information, social security numbers, for medical information,” Goldberg said. “It's actually illegal to go to a Beyonce concert and film that and distribute that, and yet not our most private information.”

Cuomo signaled his support for the legislation in a statement released ahead of a vote on the bill Thursday.

“For years I have called for outlawing revenge porn as part of our fight to combat sexual violence in all its forms,” Cuomo said. “This disgusting and insidious behavior, which can follow victims around their entire lives, has no place in New York.”

The new criminal and civil provisions of the legislation will take effect two months after Cuomo signs it into law.

READ MORE: