The fresh-faced lawyers included refugees from violence and persecution in Central America, as well as the grandchildren of refugees from Eastern Europe. They arrived at the United States Court of Appeals for the Second Circuit, in Manhattan, on Thursday in similar shades of gray and black suits, poised to continue their training in a new program to help represent immigrants.

Then a familiar face appeared unannounced in the courtroom, as adored by this group for her seat on the United States Supreme Court as for her upbringing by Puerto Rican parents in the Bronx. Justice Sonia Sotomayor ambled to the podium and said, “Well, I guess you know who I am.”

Hands covered open mouths, and gasps rose from the 25 lawyers, who make up the inaugural class of the Immigrant Justice Corps, whose goal is to address a growing problem: the dearth of qualified lawyers to represent immigrants facing deportation and other legal problems.

On the third day of their monthlong training in the rules of the country’s immigration system, the recent law school graduates expected to hear only from Robert A. Katzmann, chief judge of the federal appeals court and founder of the program. It was in the same 17th-floor courtroom where the group gathered that Judge Katzmann said he “first recognized the devastating problem of the absence of quality counsel.”