The Coast Guard and federal Public Health Service sent temporary medical help to border facilities in response. And an agencywide 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 $47 million 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 United States to request asylum. Apprehensions have dropped by nearly 100,000 since Mr. Hernandez Vasquez 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 Mr. Hernandez Vasquez’s death.

When the teenager arrived on May 13, 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 Mr. Hernandez Vasquez contact a friend or family member by phone. A shelter placement was identified on May 19, the records show, but by then Mr. Hernandez Vasquez 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.