The Supreme Court ruled Wednesday that the anti-gay Westboro Baptist Church is entitled to First Amendment protections when picketing at funerals.

The court ruled 8-1 in favor of the small Kansas church, which is mostly comprised of family members of Rev. Fred Phelps. Westboro picketed the funerals of gay men who died from AIDS for years before shifting tactics and targeting funerals of service members killed in combat in Iraq and Afghanistan. Phelps and his followers blame America’s tolerance of homosexuality for various tragedies.

A lower court had awarded $5 million to the father of a dead Marine who sued Westboro after a protest at his son’s funeral in Westminster, Md. An appeals court tossed out that judgment and the Supreme Court upheld that decision.

“Speech is powerful. It can stir people to action, move them to tears of both joy and sorrow, and — as it did here — inflict great pain. On the facts before us, we cannot react to that pain by punishing the speaker,” said Chief Justice John Roberts. “As a nation we have chosen a different course — to protect even hurtful speech on public issues to ensure that we do not stifle public debate.”

Justice Samuel Alito was the sole dissenter, writing, “Our profound national commitment to free and open debate is not a license for the vicious verbal assault that occurred in this case.”