A man who posted nude photos of his ex-girlfriend without her consent on her employer’s Facebook page is the first person to be convicted under California’s “revenge porn” law, the Los Angeles City Attorney’s Office reported Monday.

Noe Iniguez, 36, of Los Angeles was sentenced Monday to one year in jail and 36 months of probation and will be required to attend domestic violence counseling for violating both the state’s revenge porn statute and two restraining orders. He was prosecuted by Deputy City Attorney Brad Pregerson.

Iniguez’s actions, including posting derogatory comments about his ex and a topless photo of her with a message calling her a “drunk” and a “slut” and urging the employer to fire her, are part of a larger, troubling trend that pushed California lawmakers to adopt the first legislation in October 2013 against these vengeful attacks. More than a dozen states have followed California’s lead and passed similar laws.

“California’s new revenge porn law gives prosecutors a valuable tool to protect victims whose lives and reputations have been upended by a person they once trusted,” City Attorney Mike Feuer said in a press release Monday. “This conviction sends a strong message that this type of malicious behavior will not be tolerated.”

The legislation was largely in response to the increase of online attacks like those made by Iniguez and the sudden appearance of sites dedicated to revenge porn that profit off victims’ humiliation by charging them fees to remove the photos. In February, California Attorney General Kamala Harris announced she would be charging Oklahoma resident Casey E. Meyering for posting photos of California women on his revenge porn site, WinByState.

State Sen. Anthony Cannella (R-Ceres), who introduced the law under which Iniguez was convicted, told HuffPost he was proud to author the legislation.

"As technology evolves, it is important that government act to protect our citizens from new types of crime, and while I'm sad these crimes exist, I am happy to see my legislation doing what it's supposed to do -- protecting victims," he said in an email.