MADRID (Reuters) - The conservative-led Spanish parliament passed an anti-protest bill on Thursday against heavy opposition from politicians and activist groups, who say the law violates the right to protest, limits freedom of expression and gives more power to police.

The measure essentially limits demonstrations to authorized gatherings and imposes heavy fines on unauthorized protesters. Although it was watered down from a draft introduced last year, opponents say it still disregards democracy in a country that only emerged from right-wing dictatorship in the late 1970s.

Spain has seen a rising tide of street demonstrations and strikes against Prime Minister Mariano Rajoy's unpopular austerity program, including cuts to public health and education, but the protests have been mostly peaceful.

The new bill also includes tougher anti-immigration measures that will allow border police to deny entry to migrants from Africa trying to enter Spain by crossing fences at the enclaves Melilla and Ceuta.

(Reporting by Raquel Castillo; Additional reporting by Inmaculada Sanz and Edgar Aribau; Writing by Tracy Rucinski; Editing by Larry King)