(LLANO COUNTY, Texas) — Books banned by leaders in one Texas county were ordered to be put back on the shelf after a judge ruled in favor of residents suing the county.

Seven patrons of the Llano County Library System sued the county judge and county commissioners for taking books off the shelves that the county ruled were inappropriate due to their “messages and content,” according to the lawsuit.

“Within twenty-four hours of the issuance of this Order, Defendants shall return all print books that were removed because of their viewpoint or content, including the following print books, to the Llano County Libraries,” U.S. District Court Judge Robert Pitman wrote.

Additionally, the books are not to be removed until the case is decided.

At issue, was a group of library board members demanding books such as “In the Night Kitchen” by Maurice Sendak and “It’s Perfectly Normal” by Robbie H. Harris be removed.

According to the board members, the books were removed because they encouraged “child grooming” and depicted cartoon nudity.

They demanded and were successful in getting the county librarian, who is also being sued, to remove the books.

Other books the new board members complained about were books labeled “pornographic” and included books promoting acceptance of LGBTQ views.

As part of the new library board, members had control and approval of all the purchasing and content of books that entered the library system.

Judge Pitman agreed with the library patrons in part — books were removed simply because the government doesn’t like the content is a First Amendment violation.

“Plaintiffs have made a clear showing that they are likely to succeed on their viewpoint discrimination claim,” he writes in an order released on Friday. “Although libraries are afforded great discretion for their selection and acquisition decisions, the First Amendment prohibits the removal of books from libraries based on either viewpoint or content discrimination.”

Additionally, in his order, Pitman said books were removed because some people complained about them, despite one library employee admitting to not even reading the books.

The judge dismissed the claim that the online books were to be put back in the catalogue.

In February, a school in Florida covered up or removed books in a classroom that weren’t approved under a state law that restricted instruction and books on race and diversity, and made it a felony for teachers to share pornographic material to students.

Last year, a record-breaking 1,269 demands were made to censor library books and resources, the American Library Association (ALA) said.

According to the organization, it was the highest number of attempted book bans since the association began collecting data over 20 years ago.

A record 2,571 unique books were targeted for censorship in 2022, a 38% increase from 2021 when 1,858 titles were targeted.

There were 729 attempts to ban or restrict library materials in 2021, up from 156 attempts in 2020, according to the ALA.

“Of those titles, the vast majority were written by or about members of the LGBTQIA+ community and people of color,” the ALA said in a press release in March.

ABC News’ Teddy Grant and Nadine El-Bawab contributed to this report.

Copyright © 2023, ABC Audio. All rights reserved.