A federal judge in Wisconsin has struck down as unconstitutional a 1954 federal law that gives clergy tax-free housing allowances.

The decision released late Friday by U.S. District Judge Barbara Crabb could have a sweeping impact on pastors and churches across the country. Under the law, ministers don't pay income taxes on compensation that's designated part of a housing allowance.

The lawsuit was filed by the Madison-based Freedom From Religion Foundation and its co-presidents, Dan Barker and Annie Laurie Gaylor.

Gaylor said she was pleased but not surprised by the ruling.

"Even if some ministers are up in arms, taxpayers in general should know that they've been cheated by this housing allowance for many, many years, that because the clergy and churches pay less, they pay more," Gaylor said.

Crabb issued a similar ruling in 2013 on an earlier suit by the Freedom From Religion Foundation. That ruling was overturned by the 7th U.S. Circuit Court of Appeals, which said Barker and Gaylor did not have standing to sue.

Sign up for daily news! Stay informed with WPR's email newsletter.

Barker and Gaylor then applied for tax-free housing allowances as secular employees. The Internal Revenue Service turned them down. Barker and Gaylor then refiled their lawsuit, arguing they were injured by the IRS decision.

"The whole plain language of the statute, the legislative history, its practice, demonstrate a preference for ministers over secular employees, and this is a benefit that no other class of citizens in the United States receives," Gaylor said.

The lawsuit named the secretary of the Treasury, commissioner of the IRS, and the United States of America as defendants, along with representatives of three churches.

Lawyers for the defendants argued the tax exemption is justified because it provides for the unique housing needs of ministers and alleviates their financial hardship, while eliminating religious discrimination and reducing entanglement of church and state.

Crabb said despite those arguments, "a reasonable person would view the statute as an endorsement of religion."

Editor's Note: This story was last updated at 6:08 p.m. Monday, Oct. 9, 2017, with original reporting from WPR.