After a lengthy legal battle, Arizona DREAMers were granted a permanent injunction to obtain driver's licenses by a federal judge on Thursday.

U.S. District Judge David Campbell's ruling comes a month after he issued a temporary injunction that allowed young immigrants to apply for licenses if they qualified for the Deferred Action for Childhood Arrivals program (DACA), which grants deportation protection to immigrants who were brought to the United States before the age of 16 and who were under the age of 31 as of June 15, 2012, reports the Los Angeles Times.

Immigration advocates argued immigrants granted with legal status, also known as DREAMers, experience discrimination when state officials deny them the right to apply for a driver's license. However, the state said offering them licenses would lead to an abuse of government assistant programs.

Judge Campbell, however, ruled in favor of immigrants.

"The court finds that the denial of driver's licenses has caused plaintiffs irreparable harm," he said.

Arizona was one of the last states to allow DACA recipients to receive licenses, as attorneys representing Gov. Jan Brewer insisted the licenses would become a liability and be used to improperly access public benefits.

Young immigrants, on the other hand, said the policy made it difficult, and even impossible, for them to do basic and essential things, like travel from work and school, reports The The Associated Press.

Campbell agreed, writing that plaintiffs "have been unable to pursue new jobs or develop business opportunities because of their inability to drive."

Because of the ruling, more than 22,000 immigrants who were granted work permits in 2012 under President Barack Obama's deferred-action program will be able to apply for driver's licenses in the state.

In December, the U.S. Supreme Court overruled Arizona Gov. Jan Brewer's executive order that blocked young immigrants with from getting a license in the state.