A federal judge in Tyler dismissed a lawsuit on Tuesday that sought to allow churches to endorse political candidates without losing their tax-exempt status, dealing a blow to the Trump administration and other conservatives who have worked to eliminate the decades-old law barring nonprofits from supporting political office seekers.

Several Texas churches and national Christian groups brought the lawsuit challenging the Johnson Amendment, as it’s commonly known, arguing that their religious beliefs compelled them to speak to their congregations about all aspects of life, including electoral politics. Prohibiting electioneering from the pulpit in order to maintain their tax exemption was a violation of their First Amendment rights, the plaintiffs argued in their lawsuit against the Internal Revenue Service.