(CNN) The Trump administration on Wednesday announced plans to end a decades-old settlement agreement that had set a 20-day limit for holding children and issue new regulations that could hold undocumented families detained together indefinitely.

The 1997 Flores v. Reno court agreement had set nationwide policy for the detention and treatment of minors in immigration custody.

It requires the government to release children from immigration detention without unnecessary delay to their parents, other adult relatives or licensed programs, Doris Meissner, director of the US immigration policy program at the Migration Policy Institute, told CNN last year.

The settlement also required immigration officials to give detained minors a certain quality of life, including things such as food, drinking water, medical assistance in emergencies, toilets, sinks, temperature control, supervision and as much separation from unrelated adults as possible, according to a Congressional Research Service report.

During the 1980s, the former government agency Immigration and Naturalization Service was accused of mistreating immigrant children, according to the Congressional Research Service report, resulting in a series of lawsuits that ended with the Flores settlement agreement.

The agreement was named for Jenny Lisette Flores, a 15-year-old girl from El Salvador. She fled her country in 1985 and tried to enter the United States to be with her aunt.

The INS arrested her at the border, and she was placed in a juvenile detention center, where she was handcuffed and strip-searched, according to the Marquette Law Review . The INS refused to grant her aunt custody because it wouldn't release minors to "third-party adults," the law review article said.

The American Civil Liberties Union filed a class-action suit on behalf of the girl and other minors, eventually leading to the Flores agreement.

The original settlement during the Clinton administration was designed to be temporary, pending the issuance of formal regulations. But administrations for two decades had instead followed the settlement and not issued such regulations.

For years, people criticized the INS, saying it hadn't fully implemented the regulations laid out by the Flores agreement, according to the Congressional Research Service report.

Five years after the agreement, the Homeland Security Act of 2002 split up the responsibilities for processing and caring for immigrant children. Still, people worried that regulations were not being met.

In 2008, Congress passed the William Wilberforce Trafficking Victims Protection Reauthorization Act, which codified parts of the settlement into federal law, Meissner said.

In 2015, US District Judge Dolly Gee ruled that Flores requirements apply to both unaccompanied minors and children apprehended with their parents. This means that all minors must be released from detention if possible, Meissner said.

The Trump administration has made repeated attempts to change the Flores settlement agreement, arguing that it hinders the government from deterring undocumented immigrants from entering the country.

Last year, the Trump administration was criticized for its "zero tolerance policy" that led to thousands of family separations at the US border.

To comply with the Flores settlement and criminally prosecute 100% of illegal border crossings, the Trump administration separated adults from the children with whom they had crossed the border -- detaining the adults in federal prisons while awaiting their criminal proceedings and sending the children to Health and Human Services' facilities and shelters.

After mounting criticism from the public and members of Congress, President Donald Trump issued an executive order reversing course to keep the families together.

In step with Trump's executive order, Justice Department lawyers then asked Gee to modify the Flores rule to give the administration maximum flexibility in handling family units, because officials want to detain the parents not only until the end of any criminal proceedings but also through the end of any asylum proceedings, which could drag on for months.

She rejected the administration's request, saying it was "wholly without merit."