The Arizona Court of Appeals ruled Tuesday that young immigrants granted deferred deportation status under a program started by former President Barack Obama are not eligible for lower in-state college tuition.

The ruling by a three-judge panel overturns a 2015 decision by a trial court judge that said deferred action recipients were considered legally present in the U.S. under federal immigration laws and therefore qualified for state benefits.

Instead, presiding Judge Kenton Jones wrote for the court that the 2012 Deferred Action for Childhood Arrivals program known as DACA did not confer that status.

The court's decision takes Arizona in the opposite direction amid a push around the country -- including Republican-dominant states like Oklahoma, Tennessee and Nebraska -- to grant in-state tuition to immigrants in the country illegally. Tennessee recently became the 21st state to do so, earning bipartisan support from lawmakers who said it did not make sense to punish students brought to the U.S. illegally by their parents.

Jones said federal immigration law contains some groups such as legal permanent residents, refugees or people granted special status because of a spousal battery that are considered "lawfully present," but that DACA students are not among those groups. DACA recipients are granted work permits and temporary deferred deportations, but immigration law allows each state to decide on optional benefits for DACA recipients.

"Accordingly, we conclude that DACA recipients are not automatically eligible for in-state tuition benefits, but rather must look to Arizona's statutory provisions regarding alien eligibility for in-state tuition benefits," Jones wrote.

That leaves a 2006 voter-enacted law known as Proposition 300 in control. That law prohibits public benefits for anyone living in Arizona without legal immigration status.

There are nearly 28,000 DACA recipients in Arizona, and Tuesday's decision affects at least several hundred current state university students and an unknown number attending community colleges.

Maricopa Community Colleges, the largest district in the state with numerous campuses in metro Phoenix, said enrollment dropped by more than 10,000 students when the district implemented state rules on legal status required by Proposition 300.

A current community college student taking a full-time course load would see tuition go from $2,580 a year to $8,900 a year. University students pay about $12,000 a year in tuition if they are legal Arizona residents but up to $34,000 a year if they are not, depending on which of the three universities they attend.

Arizona Attorney General Mark Brnovich, who appealed the 2015 ruling, said he was sympathetic to the students but his job is to enforce the law as it is written. He said a large majority of Arizona voters approved Proposition 300 and that his job is to enforce it.

"If people don't like the law or the policies, what you do is you change the law or you change the policymakers," Brnovich said. "You don't get to pick and choose which laws you want to enforce or not."

As a candidate, President Donald Trump vowed to end a program that he called "illegal executive amnesty" but has since taken a softer stance on DACA while providing mixed signals on its future.