As part of its ongoing campaign to shut the United States’ doors to immigrants, the Trump administration announced this week that it is seeking the authority to indefinitely detain migrant families, including children. It also wants the authority to eliminate an independent licensing mechanism that would help keep the facilities where these children are held safe, sanitary and humanely administered. This is just the government’s latest attempt to supersede what is known as the Flores Settlement Agreement.

This decades-old judicial consent decree, named for a 15-year-old girl from El Salvador, Jenny Lisette Flores, has required the U.S. government to treat migrant children humanely. The battle over the agreement’s requirements, and the United States’ persistent failure to uphold them, reveals how detaining children for indefinite periods, holding them in cages and subjecting them to unsafe and unsanitary conditions is not a new development for the U.S. government.

Since the 1980s, successive administrations have used harsh detention practices, including incarcerating children, to deter future immigration. And at moments of heightened political tension over migration, the U.S. government has repeatedly chosen to short-circuit due process rather than stretch to protect basic rights. Expediency has resulted in grossly overcrowded jails, long periods of detention and limited access to basic necessities (clean water, food, medical attention) for people in custody.

The indispensable institutional checks against these rights violations have come through the courts. And the Flores Settlement Agreement, created in 1997, has been one of the most important — setting out a “nationwide policy, for the detention, release, and treatment” of all minors in the custody of the Immigration and Naturalization Service (INS), now the Department of Homeland Security (DHS).

The case began when Jenny Flores, along with three other asylum-seeking unaccompanied Central American minors, first sued the U.S. government in 1985. They alleged that they were unsafely detained with unrelated adult women in facilities ringed with barbed wire and that immigration officers engaged in arbitrary strip-searches. Flores and her co-plaintiffs were part of a wave of migrants fleeing violence, political conflict and poverty in Central America and seeking safe haven in the United States.

But the Reagan administration denied virtually all asylum applications by people fleeing countries such as El Salvador and Guatemala, classifying them as “economic migrants” rather than political refugees deserving of humanitarian protection. The administration’s operating practice was to detain all Salvadoran and Guatemalan migrants and deny them the impartial hearing they were entitled to under the law — all as part of a policy to deter further migration from the region.

Activists, appalled by this mistreatment of minors, sued. The government unconscionably argued that “because the vast majority of the plaintiff class [migrant children in INS custody] are from Central American countries where they may have had little or no rights analogous to those afforded under our Constitution, they carry no actual or subjective expectation” that they would be afforded basic rights when they entered the United States.

A federal district court repudiated that argument and concluded that these children came precisely because they expected better, hoped for better and that the Constitution’s protections applied to them, as well. In 1997, after a nine-year legal odyssey including a detour to the Supreme Court, the plaintiffs and the government reached the Flores Settlement Agreement.

It required that children in federal immigration custody be held in the least restrictive settings possible and be provided with drinking water, food, medical assistance and adequate supervision. It set the standard that these children must be held separately from unrelated adults and be released “without unnecessary delay.” The agreement also said that children should be released to parents, other relatives and then, failing a willing relative, to licensed programs willing to accept custody.

Since 1997, however, Republican and Democratic administrations alike have, in policy and practice, repeatedly attempted to limit the protections accorded by the agreement. Advocates have had to file countless lawsuits just to enforce the settlement’s guaranteed protections for children. Eight attorneys general have been named as defendants in litigation aimed at enforcing the agreement in the past 22 years.

Political pressure to restrict immigration has been the primary driver behind initiatives to negate or circumscribe the Flores agreement. When administrations have come under fire to exert control over the border, they have typically increased punitive treatment of migrants, including children, as a deterrent — even though there is little evidence that such methods do anything to stop desperate people from fleeing violence and poverty in their home countries.

For example, in 2006, when the number of families arriving at the border increased substantially, President George W. Bush’s DHS established family detention centers. But, as 8-year-old Yarely Maribel Vasquez Sanchez alleged in a 2007 American Civil Liberties Union lawsuit targeting the Hutto facility in Texas, these facilities were far from family friendly. Sanchez told the courts that she was imprisoned for two years with her mother, “rarely allowed outdoors” and “forced to wear prison garb.” Advocates and lawyers cited other instances of inhumane treatment at these facilities, including one example of officers telling the parent of a toddler vomiting blood to simply give the child water.

Although the Obama administration did end family detention at Hutto in 2009, it restarted the practice during a migration surge in 2014 when it opened centers to detain families while their cases were adjudicated. The administration’s rationale for keeping these families in custody, as in prior administrations, was that rapid adjudication and “removal” — deportation — would serve as a deterrent.

Although advocates for immigration reform, the administrations of Bush and Obama also faced public fears, fomented by conservative media outlets, that the southern border was out of control. Both concluded that the common-sense immigration policies they embraced could not be adopted or take root in the context of a politicized narrative about an overrun border. Embracing that frame, however, has not produced legislative compromise; instead it has just fueled the expansion of detention and deportation.

Although political expediency should never prevail over our obligation to treat people humanely, especially children, it repeatedly has. And this is why the Flores agreement has served as an essential check against short-term political considerations. After a lawsuit alleged that its new family detention practices violated Flores, the Obama administration sought middle ground and proposed a compromise release policy — a 20-day limit — for children in family detention centers.

Even though previous administrations were often unwelcoming to Central American migrants arriving at the border, the Trump administration has made overt hostility to them a centerpiece of its agenda. And its attempts to undermine the Flores agreement — with the well-being of children at stake — are among the most egregious expressions of this agenda.

Under the new rule, DHS — the same agency that has forcibly separated thousands of kids from their parents and continues to do so, repeatedly defended its inhumane treatment of children in federal court and recently testified that soap is not a requirement for sanitary conditions — would be granted exclusive authority to determine safe and sanitary conditions for migrant children in their custody. Flores would cease to serve as a bulwark against the abuse and indefinite detention of vulnerable children.

Trump’s DHS has demonstrated no capacity for — or interest in — providing humane treatment to children: just this month, a federal court had to once again reaffirm — over objections by the Trump administration — that Flores requires children to have access to adequate “food, water, bedding, toothbrushes, and soap.”

Until Congress demonstrates the ability to constrain this administration’s cruel policies toward migrant families, the courts remain the only institutional check against a human catastrophe. While America waits for Congress to represent our values, the Flores settlement agreement’s role in protecting children is more indispensable than ever.