Librarians could face years of imprisonment and tens of thousands in fines for providing sexually explicit, obscene or “harmful” books to children under new state laws that permit criminal prosecution of school and library personnel.

At least seven states have passed such laws in the last two years, according to a Washington Post analysis, six of them in the past two months — although governors of Idaho and North Dakota vetoed the legislation. Another dozen states considered more than 20 similar bills this year, half of which are likely to come up again in 2024, The Post found.

Some of the laws impose severe penalties on librarians, who until now were exempted in almost every state from prosecution over obscene material — a carve-out meant to permit accurate lessons in topics such as sex education. All but one of the new laws target schools, while some also target the staff of public libraries and one affects book vendors.