On Tuesday, U.S. District Judge Ricardo S. Martinez shot down the federal government’s efforts to strip Daniel Ramirez Medina of his DACA status. Immigrations and Customs Enforcement had arrested and detained Ramirez last year, then falsely claimed that he was affiliated with a gang and attempted to deport him. He filed suit, alleging that ICE had violated his due process rights. Martinez agreed. His order barred the federal government from voiding Ramirez’s DACA status, safeguarding his ability to live and work in the United States legally for the foreseeable future. What may be most remarkable about Martinez’s decision, though, is its blunt repudiation of ICE’s main claim—that Ramirez is “gang-affiliated.” The judge did not simply rule against ICE. He accused the agency of lying to a court of law.

The facts of Ramirez’s case are extremely disturbing. In February 2017, shortly after President Donald Trump unleashed immigration agents to amp up arrests and deportations, ICE agents went to Ramirez’s father’s house in Seattle to arrest him. (The father is undocumented, and brought Ramirez to the U.S. illegally as a child.) While there, they encountered Ramirez and asked him whether he was “legally here.” He responded that he was—a truthful statement given his DACA status, which he had renewed the previous May. Yet ICE officers detained him anyway. They took him to a processing center, where, once again, he told them that he had a work permit.

“It doesn’t matter,” an agent responded, “because you weren’t born in this country.”

ICE then interrogated Ramirez, fingerprinted and booked him, confiscated his work permit, sent him to a detention center, and placed him in removal proceedings. It also purported to revoke his DACA status, subjecting him to imminent deportation. Typically, the government may not rescind an individual’s DACA status without giving the beneficiary an opportunity to contest its decision. But ICE claimed that Ramirez’s DACA benefits could be terminated “automatically” because he presented an “egregious public safety concern” due to his alleged gang affiliation. (ICE routinely alleges that Latino immigrants with no indication of gang affiliation are members of a gang in order to detain and deport them.)

A group of renowned attorneys then stepped in to defend Ramirez, arguing that virtually every action ICE had taken against their client was unlawful. They also alleged that ICE’s key claim—that Ramirez is “gang-affiliated”—was a complete falsehood. One of his lawyers, Mark Rosenbaum, presented evidence indicating that ICE had doctored Ramirez’s statement by erasing words he had written in the pencil provided to make it seem as if he had confessed to being in a gang. (The original statement asserts he has no gang affiliation.) During his initial interrogation, ICE officers asked him five times whether he belonged to a gang, and he repeatedly said no. Instead, he asserted that he had “fled California [to Washington] to escape from the gangs.”

There was no reason to doubt Ramirez’s story, and good reason to believe it. If he had been in a gang, after all, the government would’ve already known. To renew his DACA status, Ramirez had to undergo two thorough background checks. Neither turned up any evidence of gang affiliation.

To renew his DACA status, Ramirez had to undergo two thorough background checks. Neither turned up any evidence of gang affiliation.

Yet ICE continued to press its case against Ramirez. In immigration court, agents rested their case on one piece of evidence: a tattoo on Ramirez’s forearm that consists of a nautical star and the words La Paz—BCS, which represent his birthplace, the city of La Paz in Baja California Sur. Ramirez repeatedly insisted that this tattoo had nothing to do with any gang. But an ICE agent claimed that his tattoo actually proved he was “definitely a gang member” because it allegedly looked like the tattoo of the “bulldogs” gang. (It does not.)

Two different immigration judges found no indication that Ramirez was gang affiliated or a threat to public safety. Martin Flores, a gang expert who has consulted in more than 700 cases, testified that he had “never seen a gang member with a similar tattoo nor would [he] attribute this tattoo to have any gang-related meaning.” Another gang expert, Edwina Barvosa, declared that there is “no apparent evidence that [Ramirez] has ever been a gang member himself.” Carlos García, a Mexican researcher who has studied gangs extensively, stated that “this tattoo does not show any gang affiliation.” But ICE still insisted that Ramirez was a gang member, and thus eligible for deportation.

Martinez, a George W. Bush appointee, was plainly incensed by the agency’s lies. ICE’s “conclusory findings,” he wrote, have “been contradicted by experts and other evidence.” The government “produced no evidence” to contradict multiple experts’ testimony discrediting ICE’s bizarre interpretation of Ramirez’s tattoo. And its claims are “completely contradictory to the government’s own previous findings after extensive background checks that were meant to uncover evidence of ‘known or suspected gang association.’ ”

“Most troubling to the Court,” Martinez continued, “is the continued assertion that Mr. Ramirez is gang-affiliated, despite providing no evidence specific to Mr. Ramirez to the Immigration Court in connection with his administrative proceedings, and offering no evidence to this Court to support its assertions four months later.”

Martinez concluded that ICE had violated Ramirez’s rights by depriving him of “his constitutionally protected liberty and property interests without due process of law.” The judge also found that ICE had violated federal law by stripping Ramirez of his DACA status in an “arbitrary and capricious” manner without any “rational explanation for its decision.” Accordingly, he barred the government from terminating Ramirez’s DACA benefits, shielding his right to continue living and working in the U.S. And he prohibited the government from “asserting, adopting, or relying in any proceedings on any statement or record … purporting to allege or establish that Mr. Ramirez is a gang member, gang affiliated, or a threat to public safety.” In other words, he ordered ICE to stop lying.

This decision marks the second time in recent weeks that a court has found that immigration agents have made misrepresentations to a court. In early May, a New Hampshire judge held that Customs and Border Protection officers had lied about a dragnet it set up in the state, claiming that it was designed to catch undocumented immigrants when it was really meant to catch drug users. Now a federal judge has ruled that ICE essentially slandered a young Dreamer to concoct the pretext necessary to deport him. There will be likely be no consequences for individual ICE agents given their broad immunity from lawsuits. But the courts, it seems, are starting to catch wise: Trump’s immigration forces, much like Trump himself, simply cannot be trusted.