NARRATION: Over 40 migrant children in U.S. custody have tested positive for coronavirus. With more than 3000 minors held in shelters and family detention centers across the country, pressure is mounting on the Trump administration to speed up releases.

CARLOS HOLGUN (GENERAL COUNSEL, CENTER FOR HUMAN RIGHTS & CONSTITUTIONAL LAW): Children come into federal custody having suffered a great deal of trauma to begin with. And so, theyre essentially fragile. Theyre children who are ill equipped to endure yet more trauma.

NARRATION: The detention of children has been an ongoing concern for Carlos Holgun during the Trump administration, which he has said has failed to meet some of the basic standards that are required when detaining minors

ARCHIVAL (KGUN9, 12-19-18):NEWS REPORT: Theres been concern about how long many of these children have been kept at these facilities.

NARRATION:standards that Holgun himself helped establish years ago, when he began investigating the detention of children in the 1980s.

ARCHIVAL (ABC, WORLD NEWS TONIGHT, 5-12-87):JOHN QUIONES: Every year thousands of children on their way to join families in the U.S. are apprehended by the Immigration Service.

ARCHIVAL (NBC, 12-1-88):ANN RUBENSTEIN: A detention center for illegal aliens. Children are mixed in with adults. The conditions here are prison like. And security is tight.

CARLOS HOLGUN: We went in and started looking into some of the facilities in which the I.N.S. was keeping the children. And, and we were appalled. These were makeshift detention facilities.

ARCHIVAL (NBC, 1-12-88):ANN RUBENSTEIN: This one is a converted roadside motel.

CARLOS HOLGUN: And they put up some chain-link and some concertina wire so that people couldnt get out. The minors had no education. There was no recreation for them. And they were, they were not permitted any visitation.

ARCHIVAL (ABC, WORLD NEWS TONIGHT, 5-12-87):JOHN QUIONES: I want to get out of here, this six-year-old is saying, I dont like it here.

CARLOS HOLGUN: Our feeling was that the children were being used as bait to capture their parents.

ARCHIVAL (ABC, WORLD NEWS TONIGHT, 5-12-87):JOHN QUIONES: The Immigration Service district director here has decided he will release undocumented children only to the custody of their parents. The problem is that the parents themselves are often illegal aliens, afraid to claim their children.

CARLOS HOLGUN: We saw that population as swelling. And it would have gotten much larger if something werent done to try to secure their release.

NARRATION: Holgun and a group of attorneys sued the government, objecting to the conditions of detention, and the policies surrounding the childrens release.

The case went all the way to the Supreme Court before the two sides agreed in 1997 to whats known as the Flores Settlement, named for one of the plaintiffs, Jenny Flores.

CARLOS HOLGUN: The government needs to place the children in a licensed facility. Normally its within 72 hours to five days. And it needs to release children to available custodians without unnecessary delay. It formalized the way the federal government was going to treat the population and the settlement continues to be in effect.

NARRATION: But 17 years later, Holgun watched as the Obama administration began detaining children who arrived with their families for long periods of time.

ARCHIVAL (CNN, 12-21-14):NICK VALENCIA: Behind the chainlink fence and just beyond the dusty dirt field sits the largest immigration family detention center in the United States.

ARCHIVAL AL JAZEERA, (7-27-14):NEWS REPORT: But since the surge of immigrants, most children have been spending days, weeks or months in these detention centers.

CARLOS HOLGUN: The policy of the administration at that point was detention without possibility of release. None of these family detention centers were licensed to care for dependent children. They were essentially prisons.

NARRATION: So Holgun and his team challenged the government again and won. A federal judge found that children who arrived with their families were also protected by Flores, and could not be held indefinitely. But the court did allow for some flexibility in how long kids could be held.

CARLOS HOLGUN: The court basically said, you have far more minors than the settlement contemplated. And so probably 20 days is going to be okay. And up until very recently, they were essentially releasing most of these families within that period. So, it wasnt a perfect world, but it wasnt anything like saying that the Flores settlement is a thorn in our side. We have it our crosshairs. We need to get rid of it as soon as possible.

NARRATION: That has been the approach of the current administration. President Trump has repeatedly railed against what he says are the loopholes that allow migrants to be released from custody.

ARCHIVAL (CBS NEWS, 10-22-18):PRESIDENT DONALD TRUMP: Its called catch and release.

NARRATION: And the administration has tried time and again to expand its powers of detention.

ARCHIVAL (MSNBC, ALL IN WITH CHRIS HAYES, 9-6-18):JULIA AINSLEY: They said they had to separate children because they couldnt hold them with their parents in detention longer than 20 days.

NARRATION: From separating families, to challenging the Flores settlement in court, the Trump administrations efforts have repeatedly been stymied. And so in the fall, they changed tactics, and tried replacing Flores altogether.

ARCHIVAL (CNN, 8-21-19):ANCHOR: The new plan paves the way for indefinite detention of families while allowing the government to use different detention standards.

NARRATION: That too, was blocked. But the administration has appealed the courts decision.

CARLOS HOLGUN: The average child who is in immigration related custody is treated much better than they were in the 80s. That being said, there certainly is a move to undo some of the gains that weve seen for this population over the years. Its an expansion of the population. Its the lengthening of the detention. This continuum of trauma where, where children will breakdown over time. And then you have some real atrocities that seem to be happening, wherethat would never have occurred in the past.

ARCHIVAL (CNN, 6-21-18):WOLF BLITZER: Very disturbing allegations against some facilities housing detained migrant children, including drugging and abuse.

CARLOS HOLGUN: I dont remember any child ever reporting that, you know what? I was wrestled to the ground and injected.

NARRATION: Now, detained minors face a new danger coronavirus.

ARCHIVAL (NBC, SAN DIEGO, 4-1-20):NEWS REPORT: There is some concern about the possible spread of Covid-19.

ARCHIVAL (NBC, SAN DIEGO, 4-1-20):NEWS REPORT: Employees working for the shelters say they fear the virus could be spreading inside and cant safely quarantine children who are showing symptoms of coronavirus because there is not enough space in the shelters.

NARRATION: Holgun and other lawyers have sprung into action, and they are relying, once again, on the protections guaranteed by the Flores settlement.

As the litigation continues to unfold, the court has ordered the government to promptly and safely release minors, or explain why they cant. But meanwhile, even more children are getting sick with Covid-19.