A Los Angeles man who posted nude photos of his ex-girlfriend online was sentenced Monday to a year in jail under California's new "revenge porn" law, authorities said.

After a seven-day trial, a jury found Noe Iniguez, 36, guilty of violating restraining orders as well as the state's "revenge porn" statute, which prohibits someone from posting nude photographs online for the purpose of causing emotional harm, according to city attorney's spokesman Frank Mateljan.

In addition to the jail term, Judge David Fields ordered Iniguez to serve 36 months' probation and attend domestic violence counseling. He must also stay away from his ex-girlfriend.

“This conviction sends a strong message that this type of malicious behavior will not be tolerated,” City Atty. Mike Feuer said.

The new law is a "valuable tool" for prosecutors looking to protect victims "whose lives and reputations have been upended by a person they once trusted,” he said.

Using an alias, prosecutors said Iniguez posted derogatory comments about his ex-girlfriend, whom he dated for four years, on her work's Facebook page in December 2013.

Months later, he posted nude photographs of her on the same page, calling her a "drunk" and "slut," Matejan said. He encouraged her employers to fire her.