Last May, Yazmin Juárez’s daughter Mariee died of respiratory infections after being released from federal immigration custody. She was 21 months old. On Thursday, Juárez filed a lawsuit against the city of Eloy, Arizona, for its failure to address inhumane conditions and substandard medical care at the family detention center in Dilley, Texas, where she and her daughter were held for 20 days.

Juárez, 21, is seeking $40 million in damages for the role Eloy played in Mariee’s “wrongful and preventable death,” according to the claim filed by the Washington, D.C.-based law firm Arnold & Porter and the Phoenix-based firm Osborn Maledon.

The claim says that Eloy, which had a contract with U.S. Immigration and Customs Enforcement to oversee the South Texas Family Residential Center in Dilley, neglected to ensure that children received adequate medial care and were kept in a safe and sanitary environment.

The city employed CoreCivic, the second-largest private prison company in the U.S., to run the detention center, despite the company’s well-documented history of detainee abuse and substandard medical care. As part of the agreement, Eloy received $438,000 each year, and CoreCivic signed a four-year, $1 billion deal to build and operate the facility.

“Despite being paid hundreds of thousands of tax payer dollars, Eloy never took a single step to learn whether the children detained at Dilley were safe,” said R. Stanton Jones, a partner at Arnold & Porter. “The tragic result [is] a small child died needlessly.”

Eloy Mayor Joel Belloc declined to comment for this story. In September, the city pulled out of its contract with CoreCivic and ICE to oversee operations at the Dilley center, almost a month after Juárez filed notice of her lawsuit.

Last March, Juárez and her then 19-month-old daughter were put in the Dilley detention center after fleeing violence in Guatemala. Mariee was healthy when she arrived, according to the lawsuit, but within a few weeks she developed a respiratory infection. Her symptoms included a fever of 104 degrees, constant diarrhea, vomiting and rapid weight loss.

The medical care Mariee received at the detention center’s clinic was “grossly inadequate and substandard,” according to Jones. The toddler allegedly only went through cursory examinations that did not properly address her respiratory infection, and on a few occasions, Juárez and Mariee allegedly waited all day to be seen by medical staff, only to be turned away and told to book another appointment. One physician allegedly prescribed Mariee Vicks VapoRub, which should not be used on children under 2, according to the medication’s label, because it can cause respiratory distress.

After more than two weeks in the detention center, Mariee was still congested, coughing and vomiting clear liquid. A nurse said she would refer the toddler to a medical provider who could more thoroughly examine her respiratory condition. Instead, a few days later, Juárez and her daughter were discharged from the detention center and sent to New Jersey, where Juárez’s mother lives. Mariee was never seen by a medical professional before she left Dilley, according to the lawsuit, despite the fact that she was “acutely ill,” according to the record from her last appointment.

“This is way out of the norm of how you would treat a child,” Jones said. “They should have sent [Mariee] for an emergency room visit well before she was discharged from ICE custody.”

The lawsuit also delves into the Dilley center’s notorious reputation for subpar medical services, describing faulty diagnoses, kids with severe symptoms being turned away from care and a child who had to be flown to a hospital after the center failed to give her adequate antibiotics.

Eloy “recklessly ignored” problems at the South Texas Family Residential Center, the lawsuit alleges, in spite of widespread media coverage and government reports about the the substandard medical care at the center and other CoreCivic-run detention facilities.

“If someone at the city of Eloy in 2014 had set up a basic Google Alert related to the Dilley detention facility, they would have received extensive information that the conditions were deeply unsafe for small children,” Jones said. “But Eloy didn’t do any of that.”

In November, a spokeswoman for ICE defended the medical care at the Dilley center to CNN.

“ICE is committed to ensuring the welfare of all those in the agency’s custody, including providing access to necessary and appropriate medical care,” the spokeswoman said. “Staffing includes registered nurses and licensed practical nurses, licensed mental health providers, mid-level providers that include a physician’s assistant and nurse practitioner, a physician, dental care and access to 24-hour emergency care.”

Within a day of arriving at her mother’s home in New Jersey, Juárez took Mariee to the emergency room because she was in “acute respiratory distress” and had a “critically low blood oxygen level of 85%,” the lawsuit says. The girl was diagnosed with a host of respiratory illnesses. Over the next six weeks, she was transferred to two different hospitals for specialized care, receiving CPR, blood transfusions and a chest tube insertion.

Her condition became progressively worse, and she died on May 10, roughly two months after arriving in the U.S.

The lawsuit says that Juárez left the hospital that day with an ink print of Mariee’s right hand, which the toddler made the day before as a Mother’s Day gift.

Juárez still lives in New Jersey. In addition to her suit against Eloy, she plans to sue the federal government and CoreCivic, though as Jones pointed out, no amount of money will bring back her daughter.

“Yasmin, despite all of her strength and bravery, is heartbroken,” Jones said. “She’s focused on seeking justice for the needless and tragic death of her only child.”