DALLAS (AP) — A Texas appeals court has ruled in favor of a gun-rights activist who complained county officials were unlawfully barring firearms from being brought into a public building.

The Court of Appeals for the 1st District of Texas found in favor of Terry Holcomb Sr. by ruling, in part, that Waller County had no standing to sue Holcomb in 2016 because a complaint he lodged should have been heard by the state attorney general’s office.

Thursday’s finding reversed a lower-court ruling.

Holcomb had challenged the county’s ban on license-holders from bringing a firearm into the county government building.

The county northwest of Houston took the unusual step of suing Holcomb, with officials explaining at the time they hoped a ruling would clarify state law on gun restrictions.

(© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)