An undocumented immigrant from Mexico who has lived in the US since he was a teenager has been granted a law license by the California supreme court, in an unprecedented ruling that could have nationwide implications.

Sergio Garcia, who was brought by his father to the US when he was 17 and who has been waiting for an immigration visa for almost 20 years, can now begin practicing law despite the fact that he lacks papers to reside in the country. The ruling breaks a glass ceiling that has dissuaded any of the 11 million undocumented immigrants in the US from attempting to enter the law.

Garcia, 36, spent more time fighting for the right to be granted a law license than he did passing his law exams. Having been brought to California in 1994, he went to college, completed a law degree and then passed the state’s bar examination.

But his entry to the bar was challenged by the Obama administration, which argued that it violated federal immigration policy. Later, the California legislature passed a law allowing law licenses to be given to undocumented immigrants; that statute went into effect this week.

“I’m speechless, tired, relieved. I’m glad it’s over,” Garcia told NBC News after the ruling was announced.

The California supreme court’s 37-page judgment could be influential in extending the rights of undocumented immigrants around the country. There are two cases involving individuals who have passed bar exams pending, in New York and Florida.

The court found that Garcia met the moral standards to practice law, noting that “he has been a diligent and trusted worker and has made significant contributions to his community”. More significantly, it underlines that being unauthorised to live in the US is a civil offence under federal immigration laws but not a crime.

The supreme court concludes that the condition of being undocumented does not “in itself involve moral turpitude or demonstrate moral unfitness so as to justify exclusion from the State Bar, or prevent the individual from taking an oath promising faithfully to discharge the duty to support the Constitution and laws of the United States and California”.

Although Garcia has won a hard-fought and important victory, his right to practice law in California will be tightly restricted. Federal laws will prohibit any law firm, corporation or public agency from hiring him, because of his lack of a visa, and he will not be allowed to engage in any immigration cases.

He might however be allowed to work as a sole practitioner, to work abroad and to take on cases in the US so long as he does so on an unpaid basis.

The California breakthrough comes at a time when the Obama administration’s push for a pathway to citizenship for the 11 million undocumented immigrants has run into the sand in Washington. Republicans in the House of Representatives have vowed to block any attempt at comprehensive reform, although there are signs that the party leadership may be prepared to back piecemeal reforms in 2014.