Carlos Gregorio Hernandez Vasquez collapsed onto the concrete floor of his Border Patrol holding cell early one morning in May. He lay still, next to a toilet in his sweatshirt and jeans for four hours before his cellmate woke up and found him dead.

Carlos, a 16-year-old from Guatemala, had arrived in the US six days earlier. At a federal processing centre in McAllen, Texas, a nurse practitioner determined he had a 103-degree fever and the flu, and recommended that he be re-evaluated and hospitalised if his condition worsened. Instead he was left in his cell.

The account of a young man’s life cut short — obtained first by ProPublica through public records — appears to contradict the government’s assurances about how Carlos was cared for. And it raises bigger questions about improvements federal authorities claim to have made to the health care provided to migrants in custody.

Following Carlos' death, a news release stated that he was discovered by federal agents during a welfare check. But a video recording provided by the police department in Weslaco, Texas, which initially investigated the case, shows that his death was flagged by his cellmate. Customs and Border Protection (CBP) officials have not explained why the recording — in which the teenager vomits blood on the floor, his body crumpling and squirming in apparent distress — has a four-hour gap or why the nurse practitioner’s advice was ignored.

In the last year, tens of millions of dollars have been poured into providing better care for sick migrants in federal custody, but problems persist. Carlos is the sixth migrant under 18 to have died in federal custody since Donald Trump took office. Though migrant children have crossed the southwestern border in large numbers during the past decade, none had died in federal custody until last year.

'Dangerous' overcrowding of migrants in US border facilities Show all 6 1 /6 'Dangerous' overcrowding of migrants in US border facilities 'Dangerous' overcrowding of migrants in US border facilities Photos of detained migrants crowded into cells at the US border - with one holding up a sign reading simply "help" - have been released as part of a new report warning of "dangerous" overcrowding. The memo was sent to the Department of Homeland Security by its Inspector General, containing photos taken at border facilities in the Rio Grande Valley over a week in June DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Eighty-eight adult males held in a cell with a maximum capacity of 41, some signalling prolonged detention to OIG Staff on June 12 DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Overcrowding of families observed by OIG on June 11, at a border patrol facility in Weslaco, Texas DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Migrant families overcrowding a border patrol facility on June 11 in McAllen, Texas DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Fifty-one adult females held in a cell designated for male juveniles with a capacity for 40 at Border Patrol’s Fort Brown Station DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Migrant families overcrowding a border patrol facility on June 11 in McAllen, Texas DHS/OIG

A spokesman for CBP who asked not to be named said in a statement that the investigation into Carlos' death was proceeding, but did not comment on the specifics of the case. In the last year the number of medical practitioners along the southwestern border has increased more than tenfold, to 250 from 20, the statement said, and it noted that most of the agency’s facilities that process large numbers of migrants have medical support available 24 hours a day.

An examination by The New York Times this year found that most of the Border Patrol’s facilities along the border did not have sufficient staffing or protocols to assess the health of migrants, and that years of warnings from both inside and outside the government had largely been ignored.

The agency has historically seen its primary mission as law enforcement but a record number of migrant families, many with young children, have created a new set of demands for caretaking.

The agency has argued that it has been overwhelmed by the large numbers and has had no choice but to hold detainees for much longer than the 72-hour stays the facilities are designed for because it does not have enough workers to process all the newcomers.

Carlos entered the US during the busiest month on record, when more than 144,116 people attempted to cross the border without authorisation.

Migrants are often sick or injured when they reach the US border — a problem that is exacerbated twice a year, by flu season in the colder months and by scorching heat in the summer. Many have walked for days or weeks by the time they arrive and are severely dehydrated and malnourished. Some traverse rocky terrain, scale walls and cross through coursing rivers full of debris.

Shelter workers who receive migrants after they are processed by federal authorities say the care the migrants appear to have received is so minimal that they often have to be sent immediately to a hospital.

Another migrant boy, Felipe Gomez Alonzo, 8, was also on his sixth day of detention in a Texas border facility and also had a 103-degree fever. He was taken to a hospital but discharged several hours later and returned to a holding cell at a Border Patrol highway checkpoint in December 2018. His condition worsened, and he died.

His death, along with that of Jakelin Caal Maquin, 7, a migrant girl who died three weeks earlier, touched off an angry backlash from the public and lawmakers, who held hearings demanding answers.

The Coast Guard and federal Public Health Service sent temporary medical help to border facilities in response. And an agency-wide evaluation that followed led the Department of Homeland Security to introduce new policies requiring Border Patrol agents to conduct more thorough interviews of incoming migrants. The department also announced a $47m (£36m) contract for migrant medical care.

The pressure on Border Patrol agents in recent months has waned because of new, more restrictive policies that have effectively blocked many migrants from entering the US to request asylum. Apprehensions have dropped by nearly 100,000 since Carlos entered the country, to 45,250 in October, the most recent month available.

Records provided by the Weslaco Police Department detail what investigators learned after local paramedics were called in response to Carlos' death.

When the teenager arrived on 13 May, his incoming medical screening from immigration authorities said he was healthy, calm and alert. No concerns were raised about his health.

He began waiting to be placed in a children’s shelter overseen by the Health and Human Services department. The facilities are designed to house young migrants for weeks or months until they can be released into the care of a family member or other sponsor, but the system was backed up in May, causing delays in placement.

Three days into his wait, according to the records, an agent helped Carlos contact a friend or family member by phone. A shelter placement was identified on 19 May, the records show, but by then Carlos was beginning to show signs of illness.

An emergency medical treatment report shows he was given Tylenol after a fever diagnosis. The nurse practitioner requested that he be evaluated again in two hours, if not sooner, and that if his condition worsened, he be sent to an emergency room. The second evaluation never happened. He got his last hot meal just after midnight.

In the hours before he died, Carlos could have been seen through a window in his cell as he collapsed onto a concrete bench and later onto the floor, where Mylar blankets, crackers and brightly coloured juice bottles lay scattered. Four welfare checks were documented during that time, but the abridged video recording does not show anyone going into or out of his cell and Carlos does not appear to move during the unexplained four-hour gap in the recording.

After he was discovered by his cellmate, a physician assistant performed a single chest compression, according to the report, but stopped when blood started to pour out of his ear and his arms stiffened, showing signs of rigor mortis. He had no pulse.

Investigators found a pool of blood around his head, though he did not appear to have cut himself. The bin next to him contained a half-eaten sandwich and two unopened frozen burritos.

The Department of Homeland Security’s inspector general is looking into the young man’s death.

Joel Rivera, Weslaco’s police chief, said the department closed its inquiry after it established there had been no foul play. He said the four-hour gap in the video was not explained by CBP officials.

“What we’ve released is what we’ve got,” he said.