“The United States government puts small children in jail to achieve a policy objective of ending unlawful immigration, and that has consequences,” said R. Stanton Jones, a lawyer for Ms. Juárez, who declined to comment. “A lot of people for a long time have believed one of the consequences of this family detention policy would be the death of a child, and that is what happened here.”

Mr. Jones said Ms. Juárez and her daughter were detained by Border Patrol agents almost immediately after they crossed the Rio Grande on a raft in March. They were held at a Customs and Border Protection processing center in McAllen, Tex., for three or four days, he said, where they slept on the floor of a locked cage with over two dozen other people, before being transferred to the facility in Dilley.

According to the complaint, Ms. Juárez said her daughter was in good health when they left McAllen but fell ill soon after they arrived in Dilley, where they were held in a room with 10 other people, five women who each had a child.

Several of the children were sick, and within a week, Mariee began to cough and develop upper-respiratory congestion, the complaint said. Over the next three weeks, her fever climbed to 104.2, she experienced extensive vomiting and diarrhea, and she lost nearly 8 percent of her body weight.

During that time, the child received treatment from at least five medical workers, only one of whom was a physician, and was given at least four diagnoses, the complaint said. Ms. Juárez was told to give her daughter seven medications, including one — Vicks VapoRub — that is labeled inappropriate for children under the age of 2.