RALEIGH, N.C. (AP) — A federal judge has dismissed a challenge to a North Carolina law that allows magistrates to refuse to marry same-sex couples by citing religious beliefs.

The judge in Asheville dismissed a lawsuit filed by three couples, two gay and one interracial. The judge ruled that the couples lacked legal standing as taxpayers to sue and lacked evidence showing they were harmed directly by the law taking effect in June 2015. Still, U.S. District Judge Max Cogburn wrote there is potential someone could suffer real harm because of the law.

The plaintiffs’ lawyers filed a notice Wednesday that they’ll appeal Tuesday’s ruling to the 4th U.S. Circuit Court of Appeals.

North Carolina is one of only two states with such religious-objection laws that are being enforced. About 5 percent of North Carolina’s magistrates have filed recusal notices.

___

This story has been corrected to show that the judge dismissed a legal challenge to North Carolina’s law but did not rule on the legality of the law.