AUSTIN — One way or another, the legality of Waller County's courthouse gun ban is heading to court.

Texas Attorney General Ken Paxton filed suit Tuesday against the county outside Houston over its decision to ban firearms in the entirety of its main court facility. Last month, the county sued the person who filed the complaint that led to Paxton's action.

The lawsuits mean that Waller County — which houses non-court offices in its courthouse — could resolve the lingering debate over what kind of gun bans that state law allows in court buildings.

Local officials, pointing to legislative history, have said state law allows guns to be prohibited in the whole of buildings that house courts. Gun-rights advocates, however, have said the law should be interpreted to cover just the parts of the buildings where there are courts and court offices.

Paxton, a Republican, has left little doubt about where he stands.

"A local government cannot be allowed to flout Texas' licensed carry laws, or any state law, simply because it disagrees with the law or doesn't feel like honoring it," he said in a written statement.

Paxton filed suit under a new state law that allows Texans to challenge the "no guns" policies offered by cities, counties and other government entities. The measure toughened a 2003 law that said gun license holders can carry at most property "owned or leased by a governmental entity."

Under the law, the attorney general is tasked with investigating any complaints and deciding whether to pursue legal action.

Though a carve-out in state law outlaws guns at the "premises of any government court or offices utilized by the court," the courthouse has emerged as an unlikely battleground over gun rights. The debate, in short, centers on the significance of the word "premises."

Faced with complaints over court gun policies, entities such as Dallas County have backed down. Others, such as the city of Austin, have remained steadfast in the face of legal action by Paxton. And then there is Waller County.

Rather than wait on the complaint process, Waller County pre-emptively sued the man who complained about their court policy: Terry Holcomb of Texas Carry, a gun-rights group.

The lawsuit seeks a declaratory judgment over who's right about the legality of the courthouse gun ban. The suit also seeks up to $100,000 in damages, though county District Attorney Elton Mathis told The Associated Press that the county wouldn't pursue monetary damages.

"The issue really needs to be put to bed," Mathis told The Dallas Morning News this month.

The county's lawsuit stirred a new controversy, with Waller County Judge Trey Duhon telling the Los Angeles Times that he has since received death threats.

Mathis, the district attorney, said Tuesday that he had not yet received the lawsuit from the state. But he said they were ready to submit, in response, a motion for summary judgment to the court to "rule on who is correct."

"Hope to have the issue resolved soon," he said in an email.