Cesar Vargas is having a big week. First the prominent immigration activist and Latino outreach strategist for Sen. Bernie Sanders helped his candidate nearly tie Hillary Clinton in the Iowa caucuses, and then, on Wednesday, he officially became the first undocumented immigrant to hold a law license in New York.

After a legal battle that lasted four years, Vargas was sworn in to practice law Wednesday at the Appellate Division, Second Department, courthouse in Brooklyn, the New York Law Journal reported.

I'll finally be a licensed attorney in my hometown of NYS! No major change in this nation is made possible by one person. THANK U EVERY1! — Cesar Vargas (@DREAMerJ_D) February 2, 2016

After Vargas announced his good news Tuesday, many immigration activists celebrated the achievement on social media. The Dream Act Coalition, a pro-immigration reform group that Vargas co-founded, posted on Facebook and Twitter to congratulate their former leader and spread word of a celebration for Vargas in Staten Island, where he grew up.

Vargas, who has lived in the United States since he was 5 years old and is now safe to stay in the country thanks to the Deferred Action for Childhood Arrivals program, passed the New York state bar exam in 2011. He had completed high school, college and law school in New York City, but the state initially said he would have to wait while it decided whether his immigration status should prevent him from becoming a licensed attorney, the New York Times reported.

Nearly four years after he first passed the bar exam, the Appellate Division of the New York Supreme Court ruled last June that Vargas had a legal right to be admitted to the state bar. Even then, there was another obstacle. Vargas had been arrested in January 2015 for trespassing when he protested speeches by several Republican presidential hopefuls. But he was discharged from probation on Dec. 8 and his case was expunged, his attorney Jose Perez told the New York Law Journal.

Ceremony is about to begin, @DREAMerJ_D waiting for his name to be announced #undocuLawyer pic.twitter.com/A1GRMWPVIy — DRM Action Coalition (@DRMAction) February 3, 2016

Sanders, whose campaign Vargas now works for, also congratulated the activist on Twitter Wednesday. The Vermont senator has taken a strong stance on immigration reform during his campaign for the Democratic presidential nomination, often going toe to toe with Clinton, who some activists have said does not go far enough to defend immigrants.

Sanders has promised to push for immigration reform with a path to citizenship for undocumented immigrants within the first 100 days of his presidency, and he strongly denounced President Barack Obama’s deportation raids on Central American families that began over New Year’s weekend.

“The growth of the immigrant detention, deportation machine and the expansion of border militarization has perpetuated unjust policies and resulted in the separation of hundreds of thousands of immigrant families,” Sanders said at an immigration reform summit in Nevada last November, the Hill reported. “The goal is to bring families together, not to separate them.”

Congrats to @DREAMerJ_D, one of our Latino Outreach Strategist, for becoming the first DREAMer lawyer in the State of NY today! Very proud. — Bernie Sanders (@BernieSanders) February 3, 2016

While Clinton is typically assumed to do better among minority voters, she and Sanders remain close in national polls, and Vargas and some other immigration reform activists see Sanders as a better option for their goals. Now, Vargas will be able to use his law license to continue fighting for immigration reform and advocating for undocumented immigrants on the campaign trail and beyond 2016.