A Guatemalan boy who died at a Texas children’s hospital after being detained on the US southern border was suffering from a brain infection, the Guardian has learned. He was the third migrant child from Guatemala to die in US government custody in the past five months.

Juan De León Gutiérrez, 16, had travelled to the US from Camotán, a poor rural community in the Chiquimula region of eastern Guatemala, hoping to be reunited with his older brother.

It is unclear when or where the boy first fell ill, but he died on Tuesday, days after being detained by Customs and Border Protection (CBP) and transferred to a government-contracted children’s detention shelter.

“My son was always healthy,” his mother, Tránsito Gutiérrez Oloroso, told local newspaper Prensa Libre. “I ask that they treat his remains with dignity.”

Juan was diagnosed with a frontal lobe infection at Driscoll children’s hospital in Corpus Christi.

Medical treatment – including surgery to alleviate the pressure caused by the infection – failed, and he died on 30 April after several days in intensive care. The boy’s older brother, who lives in Texas, visited him in hospital.

Consular officials in McAllen hope to repatriate his body to Guatemala within the next few days.

Silvia Samines, the deputy Guatemala consul in McAllen, said that efforts had been made to obtain humanitarian visas for the boy’s parents so that they could visit him in hospital, but they were unable to travel due to their advanced age. “We have started the relevant procedures in order to repatriate the body as soon as possible,” she said.

The 16-year-old was under the care of the Office of Refugee Resettlement (ORR) when he fell ill. ORR contracts private firms and charities to house thousands of children separated from their parents at the border by Immigration and Customs Enforcement (Ice) officials – as well as those detained after making the perilous overland journey from Central America without adult relatives.

Two other Guatemalan children died in US custody within weeks of each other in December 2018, but unlike the latest case, they were in custody of CBP.

Jakelin Caal, seven, who died on 8 December at an El Paso children’s hospital, and Felipe Gómez Alonzo, eight, who died on Christmas Eve at a New Mexico hospital, were part of a mass exodus from the impoverished Central American country.

Almost two-thirds of Guatemala’s population live in poverty and half its children suffer from chronic malnutrition.

In November, Guatemalans overtook Mexicans as the largest nationality taken into CBP custody – an extraordinary figure considering that the population of Mexico is seven times larger than that of its southern neighbour.

Juan entered the US near El Paso, and was detained by CBP on 19 April. He was taken by Ice agents on 20 April to a children’s facility in Brownsville which is run by Southwest Key – a not-for-profit organisation which houses up to 5,000 migrant children in more than 20 shelters.

Juan was in apparently good health when he arrived, but the next morning he was taken to an emergency room after complaining of a fever, chills and a headache. He was discharged back to the shelter later that day, according to a statement by the Administration for Children and Families (ACF).

The boy’s health deteriorated, and he was returned to the emergency room by ambulance on 22 April, said ACF. From there, the sick boy was admitted to the intensive care unit at the children’s hospital with the brain infection.

Southwest Key has not commented on Juan’s death, but an ACF spokeswoman, Evelyn Stauffer, said in a statement: “Arrangements were made for the minor’s brother and Guatemalan consular officials to visit the minor while he was hospitalised. The family who resides in the home country received frequent updates from hospital staff. The cause of death is currently under review, and, in accordance with standard ORR policies and procedures, the case will be subject to full review.”