PHOENIX (AP) — The Arizona attorney general on Monday found that the Phoenix Police Department was not violating a state law that requires officers to inquire about the legal status of people they suspect of being illegally in the country.

Republican Sen. John Kavanagh complained last month that a new police policy illegally restricted when officers can make those inquiries and violates Arizona's 2010 law known as SB1070.

Attorney General Mark Brnovich issued a written decision that rejected Kavanagh's complaint, saying that the police policy was fully compliant with the law. That's despite what the decision called "aspirational language" in the order that was boosted by City Council members' goal to be welcoming to the immigrant community.

"At the end of the day, the city of Phoenix's operations orders do not violate state law, and they are completely consistent with state law, including what people commonly refer to SB 1070," Brnovich said in an interview. "It confirms that the Phoenix Police Department has a role in immigration enforcement, and it also mandates that officers also reach out to (U.S. Immigrations and Customs Enforcement)."

Kavanagh, a Republican from Fountain Hills, had said in his complaint that the policy changes adopted by the department in July illegally restricted when officers can inquire about a person's immigration status. In addition, he said a new procedure requiring a specialized supervisor to vet the request puts roadblocks in the process to check with federal immigration officials. He also said a ban on officers inquiring about immigration status while on school grounds makes schools "sanctuary islands."

The attorney general's analysis said that while some parts of the order may seem to prohibit actions required under SB 1070, those exceptions are overridden by other sections and the overall policy, including the ban on questioning people at schools.

"Critically, these routine parameters give way when officers encounter the specific, mandatory circumstances" in other parts of the policy, said the decision written by O.H. "Doc" Skinner, Brnovich's government accountability unit chief.

On Monday, Kavanagh said that while he thought Brnovich's office may have found the policy in technical compliance, the Phoenix policy at least violates the spirit of the immigration law.

"They may have legally gotten away with this. But clearly most police officers that read this are going to think that they can't question somebody who they stop unless it's for a criminal matter," Kavanagh said. "I wouldn't have a problem if people only hired attorneys who know how to read convoluted policies, but they don't."

The new Phoenix Police operations order was crafted to closely align with those of Mesa, Tucson and the Maricopa County Sheriff's Office.

"Throughout the revision process, I had three goals which we were confident we would be able to achieve: ensure the trust of our victims and witnesses, protect our school children, and remain compliant with state, local, and federal laws," Chief Jeri Williams said in a statement.

Kavanagh filed the complaint under a 2016 law allowing a single lawmaker to trigger an investigation if they believe a city or town is violating a state law. If the attorney general determines the policy conflicts with state law, the municipality has 30 days to eliminate it or face loss of state tax revenue.

The U.S. Supreme Court struck down parts of SB 1070. But the high court upheld the section requiring officers to check a person's immigration status while enforcing other laws if they reasonably suspect the person might be in the country illegally.