PHOENIX — Gov. Doug Ducey is acting illegally in shuttering bars while allowing restaurants to remain open and continue to sell alcoholic beverages, the state’s top prosecutor charged Friday.

In new court filings, Attorney General Mark Brnovich said state lawmakers have given the governor certain powers to act on his own in cases of declared emergency.

But Brnovich said those law require Ducey to act “consistent with other statutes and the constitution.’’ He said nothing in the statute entitles the governor to issue orders that are “arbitrary, unreasonable and discriminatory,’’ which is what Brnovich said is happening here.

The attorney general said Ducey not only is allowing restaurants to remain open but even to sell alcoholic beverages to go, an action prohibited by state law. Brnovich said nothing in the powers lawmakers gave the governor to act in cases of emergency allows him to ignore state law.

Brnovich said if Ducey believes there is a reason for closing bars and giving more rights to restaurants there’s a simple solution: Call the legislature into special session and ask for the power to do that. Ducey has not done that, even though he issued his first executive order in March.

“It is incumbent on the governor to promptly call the legislature into extraordinary session during this extraordinary time,’’ wrote Assistant Attorney General Beau Roysden on behalf of Brnovich. “Nearly six months into the declared emergency, it is long past time for the governor to follow the constitution and convene the legislature rather than contravene lawful statutes through executive fiat.’’

Gubernatorial press aide Patrick Ptak defended his boss’ action and said he is doing nothing wrong.

“Throughout the response to COVID-19, the governor has had to make tough decisions to protect public health,’’ he said. Ptak said Ducey is acting consistent with state law and in consultation with the White House Coronavirus Task Force.

“These executive authorities exist to protect public health,’’ he said. Ptak said the actions the governor has taken so far using that power “have clearly made a positive impact in combating COVID-19.’’

Brnovich, in his legal filings, does not address the health issues. Instead, he said, it’s a simple legal question of whether the governor can ignore state laws.

The new filing puts the attorney general on the side of more than 100 bars who have been forced to close by the governor’s orders. They are asking Maricopa County Superior Court Judge Pamela Gates to allow them to reopen.

Their attorney, Ilan Wurman, contends that Ducey does not have the constitutional authority to shut down bars — or any other business for that matter. Wurman raises many of the same arguments about discrimination.

Arizona law establishes multiple categories of licenses for people to sell alcoholic beverages.

One of the big categories is bars, consisting of Series 6 licenses to sell all alcoholic beverages and Series 7, which is for bars that serve only wine and beer. The other big category is Series 12, which is for restaurants.

The big difference is that bars do not need to meet the requirement that at least 40 percent of their gross proceeds come from the sale of food. They also have the right to sell beverages out the door, something Ducey gave to restaurants even though they are not entitled to that under Arizona law.

All that makes bar licenses more valuable, especially as there are a limited number in each county.

Other types of licenses are available for microbreweries, hotel bars, wineries, private clubs and tasting rooms.

Ducey’s order shut only bars.

In responding to the lawsuit, the governor said the discrimination is justified.

“Patrons of bars are more likely to become impaired, which can cause patrons to be less cautious of COVID-19 mitigation strategies like physical distancing and mask wearing, not to mention that patrons who are drinking are unable to wear a mask,’’ Ducey’s lawyers said.

Brnovich said that argument is unconvincing.

“Both bars and restaurants are already prohibited from serving a patron to the point of intoxication,’’ he said.

Anyway, Brnovich said, if the issue is food — the sole distinction that separates bars from restaurants — the legal solution would be to require bars to meet the same 40 percent food sales requirement, a move that would treat all establishments equally.

What makes matters worse, he said, is that bar owners who violate the governor’s orders are subject to criminal penalties, including fines and jail time.

In filing the brief, Brnovich told Gates this is about more than just how Ducey is, in his opinion, violating state laws by shutting down bars. For example, he said, the governor, without seeking legislative approval, has effectively repealed a state law regarding the training required to be certified as an assisted living facility caregiver.