The law targets "sexting," the practice of sending explicit photos by cell phone, email or Internet posts. The nationwide problem has confounded parents, schools and police.
The bill gives first-time offenders the chance to complete an education program.
Lawmakers took up the issue after a 14-year-old girl allegedly uploaded nude pictures of herself and was arrested on child pornography charges last summer. She eventually received probation and court-ordered counseling