CHICAGO (AP) — Illinois lawmakers greenlighted a bill Wednesday that says libraries in the state must adopt an anti-book banning policy to receive state funding, in a vote that fissured along party lines.

The measure, spearheaded by Secretary of State Alexi Giannoulias, represents a counter-movement to growing efforts to restrict books on topics such as race, gender and sexuality in schools and libraries across the United States.

The legislation has passed both chambers and now heads to the desk of Gov. J.B. Pritzker, who said he looks forward to signing it.

“This landmark legislation is a triumph for our democracy, a win for First Amendment rights, and most importantly, a great victory for future generations to come,” said Giannoulias in a news conference Wednesday after HB 2789 cleared the Senate in a party-line vote.

In order to be eligible for state funding, the bill requires libraries to adopt the American Library Association’s Library Bill of Rights, which holds that “materials should not be excluded because of the origin, background, or views of those contributing to their creation,” and “should not be proscribed or removed because of partisan or doctrinal disapproval.”

Libraries may also develop an alternative policy prohibiting the practice of banning to receive the funds.

Chicago-area Sen. Laura Murphy, a Democrat and one of the bill’s sponsors, celebrated its passage.

“Our nation’s libraries have been under attack for too long — they are bastions of knowledge and proliferate the spread of ideas,” said Murphy in a news release. “Librarians are trained professionals, and we need to trust that they will stock our libraries with appropriate materials — they were hired for their expertise, and they deserve our respect.”

All 19 Republicans in the Illinois Senate voted against the measure, including Republican Sen. Jason Plummer, who represents Edwardsville, a city northeast of St. Louis.

Plummer said the bill is an effort by Illinois Democrats “to force their extreme ideology on communities across this state” and would wrest control from local libraries.

“The members of locally elected library boards, who work to increase literacy in their communities, don’t need a book-ban agenda foisted on them by Chicago politicians who are just trying to get cheap publicity,” Plummer said in a news release.

“It’s offensive to the ideals of good government to threaten to take public funding away from the very communities that generated that funding through their taxes,” he said.

Giannoulias, a Democrat, said he is “blown away that this has become a partisan issue.”

Attempted book bans and restrictions at school and public libraries hit a record-high in 2022, according to a March report from the American Library Association.

Giannoulias, who in January was sworn in as the first new secretary of state in a quarter-century, teamed up with Naperville Democratic Rep. Anne Stava-Murray after parents in the Chicago suburb of Downers Grove complained to the high school board about “Gender Queer: A Memoir” by Maia Kobabe last summer.

State Senator Terri Bryant (R-Murphysboro) released a statement following the passage of House Bill 2789, which requires local libraries or library systems to adopt the American Library Association’s Library Bill of Rights in order to be eligible for state funding.

“We already have two Bill of Rights, one within the Illinois Constitution and another in the U.S. Constitution. These Bills of Rights as well as our entire state and federal Constitutions are the codes of conduct that govern all elected Illinois officials, including our locally elected library boards. There is absolutely no reason for Illinois libraries to be forced to adopt a so-called ‘Library Bill of Rights’ created by a little-known national organization that is not elected or beholden to the people of our state. Nor should our local libraries’ funding be threatened if they disagree.”