A Los Angeles man who posted topless photos of his ex-girlfriend online became the first person sentenced under California’s new revenge porn law on Monday.

A jury found Noe Iniguez, 36, guilty of violating two restraining orders and the state’s revenge porn law after deliberating for seven days.

“Revenge porn” is a term for posting intimate photos of someone on the Internet to get even with them. Enacted in 2013, the California law makes it illegal to distribute private, sexually explicit photos or videos online without consent of the person who appears in them. Originally the law only covered photos and videos taken by someone else, but in August it was expanded to include selfies.

According to prosecutors, Iniguez’s ex-girlfriend of four years got the first restraining order against him in November 2011 after he started sending her harassing text messages. A month later Iniguez, using a fake name, posted insulting comments about his ex on her employer’s Web site. In March, he posted a topless photo of her, labeling her “drunk” and a “slut” and urging her employer to fire her.

Iniguez was sentenced to a year in jail and three years of probation. He was also ordered to attend domestic violence counseling and stay away from the victim.

“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,” Los Angeles City Attorney Mike Feuer said in a statement. “This conviction sends a strong message that this type of malicious behavior will not be tolerated.”

California is one of 13 states to enact a revenge porn law since 2013. Such laws vary from state to state. In Arizona, one of only two states where posting revenge porn is a felony on the first offense, a federal district court judge blocked enforcement of the law last week after the American Civil Liberties Union sued.

The civil rights group argued Arizona’s law is so broad that it criminalizes artists, historians, booksellers and others who may publish nude images for reasons other than revenge. An example cited is the Pulitzer Prize-winning photo of a nude, burned Vietnamese child fleeing her bombed village.