Gov. Jerry Brown signed Senate Bill 255 into law Tuesday, making the act a misdemeanor offense.
A person who is caught electronically distributing nude pictures in a sexual nature can be charged under the new law. The photos must have been posted without permission of the victim, or with the intent to harass or humiliate them.
Offenders can face up to six months in jail and a $1,000 fine.
"Until now, there was no tool for law enforcement to protect victims," the bill's author, Sen. Anthony Cannella, said in a statement. "Too many have had their lives upended because of an action of another that they trusted."
The American Civil Liberties Union had opposed the bill, arguing it might restrict free speech rights.
The Associated Press contributed to this report.