HARRISBURG, Pa. — Pennsylvania's state Senate approved legislation Thursday that would block state aid from going to any university that boycotts or divests from Israel, following pro-Palestinian protests on college campuses across the country that included demands for divestment.

The measure, which passed by a vote of 41 to 7, also would bar the state treasurer and public pension systems from boycotting or divesting from Israel's government or commercial financial activity in that country.

The bill won support from all but one Republican and most Democrats. It now goes to the House.

Supporters of the legislation said it was motivated by a desire to support an ally nation in its war with Hamas, to fight a rising tide of antisemitism in the United States and to alert state-subsidized universities that they must protect Jewish students from threats and bullying by anti-Israel protesters.

The bill was opposed by some of the Senate's more liberal members, including Democrat Art Haywood, who said he was concerned that it would restrict free speech.

Fellow Democratic Sen. Steve Santarsiero, who was a sponsor, disputed that the bill infringes on freedom of speech and said students and faculty will still be able to protest peacefully.

The bill does not punish universities that make investment decisions to fulfill their fiduciary responsibility to maximize returns, and it has has no impact on personal college investment accounts or student loans, Santarsiero said.

Another supporter, Democratic Sen. Judy Schwank, said she hopes it sends a message to college administrators and boards of trustees that are responsible for campus safety.

''Bodily harm, death threats, go beyond just hurt feelings and they certainly stretch the limits of free speech,'' Schwank said.

Pennsylvania sends more than $2 billion annually to institutions of higher education through direct appropriations and student grants. Much of it goes to the system of 10 state-owned universities, along with Penn State, Temple University, Lincoln University, the University of Pittsburgh and the University of Pennsylvania.

Demonstrators at campuses across the country have sparred over the Israel-Hamas war this year.

To end encampments without using police force, some schools negotiated with protesters over their divestment demands: Rutgers, in New Jersey, agreed to discuss severing business ties with Israel, while Illinois' Northwestern revived a committee on ''investment responsibility.''

No Pennsylvania schools that receive state aid reported that they had agreed to protesters' demands to divest from Israel.

Encampments at the University of Pennsylvania and at Drexel University in Philadelphia ended after the schools called in police.

Liz Magill, Penn's president, resigned in December amid pressure from donors and criticism over testimony at a congressional hearing where she was unable to say under repeated questioning that calls on campus for the genocide of Jews would violate the school's conduct policy.

___

Follow Marc Levy at www.twitter.com/timelywriter.