The state attorney general on Wednesday issued a binding opinion that schools cannot prevent a student from participating in graduation exercises over unpaid lunch debt.

The opinion, regarded as law unless a court or the Legislature says otherwise, says existing statutes already prohibit withholding a diploma for nonpayment of fees or demeaning a child over unpaid lunch debt.

"Minnesota law supports the principle that living with the dignity and respect that comes from participating in a graduation ceremony cannot be restricted by your ability to afford your life," Attorney General Keith Ellison said.

The opinion comes several days after a Mid-Minnesota Legal Aid attorney asked Ellison and the Department of Education to weigh in on a case where lunch debts had caused a public outcry. Attorney Jessica Webster said she heard that Cooper High School in New Hope was preventing students who still owed lunch money from walking through graduation exercises. A school spokeswoman said that was never the case.

A private foundation begun by Valerie Castile, mother of 2016 police shooting victim Philando Castile, stepped in to pay the seniors' lunch debt of $8,000. Castile said she made the payment to honor her son, a longtime school lunchroom employee at a St. Paul school.

Punishing students for overdue lunch payments has proved broadly unpopular. A rural Minnesota district two years ago faced widespread condemnation after a cafeteria worker or workers scraped food off offending students' trays.

A local media report caused a firestorm and led to a State Capitol news conference about the practice of lunch shaming. Within weeks, the school reversed its policy, focused on collecting debt from parents rather than punishing students, and began offering hot lunches to all kids regardless of their ability to pay.