In August, the A.C.L.U. brought a class-action suit on behalf of dozens of minors rounded up in ICE gang operations all over the country, demanding that they be given hearings to challenge the evidence against them. The group included the student Palacios represented and a handful of other students from Huntington High; Alex had just turned 19 when he was arrested, so he didn’t qualify for the suit. Many of the minors had been sent to a high-security detention center for children in Virginia, where some were strapped to chairs with their heads covered or held naked in dark rooms. A 15-year-old Huntington student, George (his middle name), tried to kill himself twice, once by hanging himself and once by slitting his wrist.

After a few weeks, the Virginia staff decided that the facility was too restrictive for the well-behaved Long Island teenagers. That summer, the director of a California detention center asked to see ICE’s evidence that the detainees were gang members. When ICE wasn’t forthcoming, he refused to hold them, and starting in August 2017, they were sent to a group home run by ICE in upstate New York called Children’s Village.

In November 2017, a federal judge ruled that ICE would have to hold individual hearings and present evidence that each minor was a danger to the community. The lead case involved a Brentwood High student, Noel (his middle name), who ICE said was dangerous because he had been seen with suspected MS-13 members and had written the number “503” in a school notebook. ICE labeled Noel a “gang member” when he was detained, then downgraded him to a “probable member” and finally, on the day of his hearing, settled on calling him a person identified by a school resource officer as “associated” with the gang. In an immigration courthouse in Lower Manhattan, Judge Aviva Poczter ordered Noel’s immediate release, noting that 503 is a country code. “I think this is slim, slim evidence on which to base the continuing detention of an unaccompanied child,” Poczter said.

In other hearings, ICE presented evidence pulled from the Suffolk Police Department’s gang database. Again and again, judges found that the material — a student cited for a gang tattoo who didn’t have a tattoo; a photo of a group of suspected gang members that did not include the student in question — was far too weak or inaccurate to detain the students. In the cases involving Huntington students, the “Huntington High resource officer” kept coming up. In one case, he reported that one student was “found to be in possession of MS-13 drawings in his school work.” In another, he reported that a student had written “MS-13” on his arm. Ultimately, 30 of the 32 teenagers in the A.C.L.U. lawsuit were freed, including Palacios’ client, who returned to school. But of the hundreds of people administratively detained in Operation Matador, most were not minors, and they were fighting losing battles to be allowed to challenge, or even see, the evidence against them.

It took Alex’s parents days to find him. He had been taken to a jail in New Jersey that was being used as an immigration detention center and housed other Long Island students, including some from his high school. It was less than two hours from Huntington, but for his parents it might as well have been across the country: If they tried to visit, they could be detained. Alex wouldn’t let his parents take the risk. And he felt sure ICE would release him before the start of his junior year. If everyone always told him that doing well in school was so important, how could officials prevent him from going to class?

When the first week of school came and went and he remained in jail, he fell into despair. “I don’t know how much longer they’ll keep me in here, or what my life will be like when I get out,” he told me in a visiting room in September 2017. He wore a bunchy orange jumpsuit and canvas slip-ons that his big toe had worn a hole through; his fingernails were long and ragged because he couldn’t find nail clippers. “The most important thing is to finish high school. But I don’t know if the principal will let me back in.”

Many of the Operation Matador detainees had been moved to the same maximum-security unit, which was about the size of the Huntington High cafeteria. The detainees spent most of their time staring out the windows at sooty buildings and industrial lots or watching soccer games and soap operas on TV. Alex was rarely able to take the classes that the jail offered, because criminal inmates were given priority. “Even when I get out of here, how will my mind be?” Alex asked his parents in one of his nightly calls. In another he told his mother about jumping out of the way when a fight broke out in the ward, and narrowly avoiding getting blood on his shoes. He was nervous about his current cellmate, who he thought was an MS-13 member and a drug addict. He could hear the other boy muttering and pacing at night and was terrified to go to sleep locked up alone with him.