The California Supreme Court has ruled that an undocumented Mexican immigrant should be authorized to the State Bar and practice law, a decision already hailed as a major victory for immigrants trying to win more rights in the US.

The court ruled unanimously in favor of Sergio Garcia, who can now begin practicing law immediately despite his status as a non-US citizen. He had challenged a 1996 federal law meant to prohibit people living in the US illegally from being granted a professional license from federal agencies.

The US Justice Department has opposed Garcia’s licensing, while the California Attorney General’s office was in favor of it.

“We conclude that the fact that an undocumented immigrant’s presence in this country violates federal statuses is not itself a sufficient or persuasive basis for denying undocumented immigrants, as a class, admission to the State Bar,” wrote California Chief Justice Tani Cantil-Sakauye.

In contrast to the federal law, California lawmakers passed a state law in October granting immigrants who were brought to America by their parents to become lawyers. California was the first state to pass such a bill - which was quickly signed into law by Governor Jerry Brown – although Florida and New York are considering similar legislation.

Garcia came to the United States with his father, an agricultural worker who obtained his US citizenship, as a 17-month-old child. He returned to Mexico when he was 9, then entered the US illegally when he was 17 years old.

The young man graduated from Durham High school in Butte County, California and earned a law degree in Cal Northern School of Law, according to the Los Angeles Times. He then passed the State Bar exam on the first attempt, at which point the Bar recommended he be allowed to practice, but Garcia has been held back by his murky legal status.

Garcia will be able to practice law, but whether he will be allowed to charge clients for his service has not yet been determined.

“We assume that a licensed undocumented immigrant will make all necessary inquiries and take appropriate steps to comply with applicable legal restrictions and will advise potential clients of any possible adverse or limiting effect the attorney’s immigration status may pose,” the court ruled this week.

Garcia’s father applied for a green card on behalf of his son in 1994. The application was approved in 1995, but he still has yet to receive a green card. Obama administration lawyers told the California Supreme Court they were against the court making a ruling in favor of Garcia but promised they would not intervene if the state legislature passed a law expanding immigrants’ rights.