(CNN) -- Sergio Garcia's parents brought him to the United States from Mexico nearly two decades ago. He's been waiting for a green card ever since.
But there's one thing the undocumented immigrant no longer has to wait for, according to a California Supreme Court ruling on Thursday: his law license.
Garcia can be admitted to California's state bar and legally practice as a lawyer there, the court ruled.
The landmark case quickly caught the eye of activists on both sides of the national immigration debate.
Garcia, 36, says his American dream has finally come true.
"With tears in my eyes I'm happy to report I am being admitted to the bar, thank God!" he said in a Facebook post Thursday after the court's ruling. "This one is for all of you who dare to dream and by doing so change the world! Love you all! History was made today!"
But the case raises many questions, particularly among those who have been critical of Garcia's efforts to practice law.
"How is Garcia supposed to uphold 'the laws of the United States' when he is, by his mere presence in this country, in violation of federal law?" CNN contributor Ruben Navarrette asks in an opinion column he wrote on the case in September. "How does he pledge to show respect for 'the courts of justice' when, for most of his life, he has lived here in defiance of the rule of law? And how can he claim that he won't 'mislead' a judge or judicial officer when living in the United States illegally requires deception on a daily basis?"
California's Supreme Court ruled Thursday that no state law or public policy should stop Garcia or others like him from obtaining a law license in the state.
Immigration officials would be unlikely to pursue sanctions against an undocumented immigrant who had been living in the United States for years, had been educated in this country and whose sole unlawful conduct was his presence in this country, the court said in a unanimous ruling written by Chief Justice Tani Cantil-Sakauye.
"Under these circumstances, we conclude that the fact that an undocumented immigrant's presence in this country violates federal statutes is not itself a sufficient or persuasive basis for denying undocumented immigrants, as a class, admission to the State Bar," the court ruled.
A lengthy legal battle
Garcia was born in Mexico in 1977 and taken to California by his parents when he was 17 months old, according to court documents.
He remained there until 1986, when he and his parents returned to Mexico. Eight years later, at age 17, Garcia again returned to California with his parents and without documentation, though his father had obtained permanent resident status in the United States.
That year, Garcia's father filed an immigration visa petition on his son's behalf, which federal immigration officials accepted in 1995. But, 19 years later, the visa has not been granted, even though Garcia has lived in the state since 1994.
"Because the current backlog of persons of Mexican origin who are seeking immigrant visas is so large, as of the date of this opinion -- more than 19 years after Garcia's visa petition was filed -- a visa number still has not become available for Garcia," the Supreme Court's ruling said.
The ruling marks the end of a lengthy legal battle for Garcia, who received a law degree from Cal Northern School of Law in 2009.
That year, he passed the California bar exam.
For about two weeks, Garcia was sworn in as an attorney. Then he received a notice from the state bar that his admission was in error.
"It was very, very hard for me to have to tell my family that the celebration we had meant nothing," Garcia told CNN en Español in September. "It killed me inside to tell them that I really wasn't a lawyer."
The matter ended up in the California state court system, and Garcia earned the support of California Attorney General Kamala Harris, who wrote in a 2012 brief: "Admitting Garcia to the bar would be consistent with state and federal policy that encourages immigrants, both documented and undocumented, to contribute to society."
The state bar argued that Garcia had met all of California's requirements for a law license.
"With today's ruling, the California Supreme Court reaffirms the Committee of Bar Examiners' finding as not a political decision but rather one grounded in the law," California State Bar President Luis J. Rodriguez said in a written statement Thursday.
Case could set precedent
Critics have argued that giving Garcia a license wouldn't make sense. How can someone without legal status become licensed as a lawyer, whose job entails upholding the law?
Larry DeSha, former prosecutor for the State Bar of California, said Garcia shouldn't be given his law license because his immigration status would be in violation of a civil immigration statute and could affect his ability to represent his clients.
"In the immigration debate, we must separate the individual from the idea. The individual -- Garcia -- looks like a keeper. The idea -- that one who has lived most of his life outside the law can practice law -- is problematic," Navarrette wrote in his September column.
The executive director of the Center for Immigration Studies, which favors tighter immigration restrictions, said the case is part of a troubling trend.
"The ruling that an unlawful immigrant can be admitted to the practice of law in California is the kind of thing that will light up talk-show switchboards, and rightly so. But beyond the Bizarro World nature of the decision is a broader issue," Mark Krikorian wrote in an editorial published on the National Review's website. "This is only the latest in a series of measures by some jurisdictions to normalize illegal immigration."
The Obama administration originally opposed Garcia's admission to the bar, saying that federal law demanded that legislation be enacted granting an undocumented immigrant the right to practice, according to a summary published by lawprofessors.typepad.com.
But the Justice Department backed off in November after California's governor signed a new law that did just that.
The bill, which passed in October and went into effect this week, allows the bar to admit "an applicant who is not lawfully present in the United States (who) has fulfilled the requirements for admission to practice law."
That "greased the skids" in making the court's work easier, said Dan Kowalski, editor of Bender's Immigration Bulletin and himself an immigration attorney.
"I think it's a natural, logical decision," he told CNN in a telephone interview, adding that he expected other states to follow suit.
Víctor Nieblas, an immigration attorney based in Southern California, told CNN in September that the court's decision could affect hundreds of other young professionals in the United States who are seeking a license.
"He's the first, but he's not the only. There are cases going on in New York and Florida," said Rina Gandhi, a third-year law student at the College of William and Mary in Williamsburg, Virginia.
Gandhi, who heads an immigration law and service organization that invited Garcia to speak at her school last year, said the ruling is a positive step.
"I'm glad to see us moving forward in the right direction," she said, adding that the case highlights the problems caused by backlogs in the country's immigration system.
"He does have an immigration application pending," she said. "It's more a result of the broken immigration system that we currently have that he's been waiting 19 years."
CNN's Cindy Y. Rodriguez and Jaqueline Hurtado contributed to this report.