California Gov. Gavin Newsom has signed a bill into law that bans "lunch shaming."

The Associated Press reported the new law, signed Saturday, effectively makes it illegal for schools to give students alternative or cheaper meals if they owe money.

CNN reported that the law, written by California Sen. Robert Hertzberg, says "the pupil is not shamed or treated differently from other pupils."

Newsom said in a statement that the actions of 9-year-old Ryan Kyote, a student at a Napa County elementary school, contributed to the inspiration for the bill.

Ryan made headlines earlier this year and drew national attention when he used his allowance to pay off the lunch debts of his classmates.

"He showed how at many schools across the country, students whose parents are not able to pay for their lunch are given a cheaper, 'alternative' lunch that causes them to stick out from their peers," Newsom said.

He added, "I want to thank Ryan for his empathy and his courage in bringing awareness to this important issue."