After five months locked up in detention, F.E.* returned home to Brentwood, New York. “I thought I’d never see my 'Mami' again," the 17-year-old said.

His offense? Scribbling “503,” the calling code for El Salvador, in his school notebook and allegedly hanging out with the “wrong people” at his high school. Local police, along with Immigration and Customs Enforcement officers, claimed this implicated F.E. as a gang member, which meant that ICE could arrest him, send him away across the country, and detain him for months — all without notifying his family or giving him a hearing.

They were wrong.

The American Civil Liberties Union, the ACLU of Northern California, Cooley LLP, and the law offices of Holly S. Cooper recently won a federal court ruling that prevents the federal government from detaining juveniles like F.E. without showing that their detention is justified. The case, Saravia v. Sessions, is a class-action lawsuit on behalf of immigrant minors who were living with their families and sponsors when they were arrested on allegations of gang membership. Like F.E., all of the juveniles in our class were arrested by ICE and scattered in detention centers throughout the country — often thousands of miles away from their communities — based on unproven accusations that they were gang members.

The district court in Northern California recognized that ripping juveniles from their homes and locking them up deprives them of their most basic freedoms. The court put reasonable procedures in place to prevent that from happening unfairly. Now, each juvenile in our class must be given a prompt post-arrest hearing before a neutral decision-maker. The government must present evidence to justify the minor’s detention, and that hearing has to take place before the minor is sent to a faraway detention center.

The government’s treatment of teenagers like F.E. is part of a larger effort to spread fear and misinformation about immigrants in order to justify its harsh enforcement practices. Local police in Suffolk County — where many of our class members are from — have admitted that when they can’t come up with evidence that a juvenile they’re targeting has committed a crime, they accuse the minor of being a gang member so that ICE can arrest him and put him in immigration detention.

“There are times when we know someone is an MS-13 gang member, and we know someone is an active MS-13 gang member, but we’re not in a position to make a criminal arrest,” Timothy Sini, the Suffolk County police commissioner, told The New York Times. “So another tool in our toolbox is to work with the Department of Homeland Security to target active known MS-13 gang members for violation of civil immigration laws, which is another way to remove dangerous individuals from our streets.”

But these accusations often fail to hold water. The day after the Saravia court issued its order, F.E. had a hearing in front of an immigration judge, who evaluated the paltry evidence that he was a “dangerous” gang member. The judge found that evidence, which included the scribbled El Salvador country code, lacking. He ordered F.E. released back to his family.

Over a dozen other class members have similarly been ordered released since the Saravia ruling. This proves what we knew all along: If these minors are given a fair shot at challenging the evidence against them, they’ll show that there’s no reason to keep them locked up.

*Plaintiff is identified by initials to protect his identity.