By Sofia Menchu

WASHINGTON (Reuters) - A 2-1/2-year-old Guatemalan migrant boy who was detained last month at the U.S.-Mexico border but released from U.S. custody with his mother during treatment for an illness has died in hospital, authorities said on Wednesday.

The death comes after three Guatemalan minors died in U.S. custody since December, during the biggest surge of migrants on the U.S.-Mexico border in a decade. More Guatemalans are crossing the border than citizens of any other nation.

The deaths have spurred greater criticism of the Trump administration's hardline stance on illegal immigration, as well as closer scrutiny of why some migrants from Central America travel with children on the long, dangerous road north.

Tekandi Paniagua, Guatemala's consul in El Paso, Texas, said the boy had been detained by U.S. migration officials after entering the United States in early April with his mother near the Mexican city of Ciudad Juarez, opposite El Paso.

"He had health problems because of the conditions in which they were traveling, high fevers and difficulty breathing," Paniagua said.

The boy, who was not identified, was taken to hospital, where doctors diagnosed pneumonia, he said, adding that the boy died on Tuesday.

A U.S. Customs and Border Protection official familiar with the case said the boy's mother told agents her son was ill three days after the family crossed the border on April 3.

He was taken to hospital the same day, and moved to a children's hospital a day later, the official said, adding that the family was officially released from CBP custody on April 8, while the boy was in hospital.

Guatemalan foreign ministry spokeswoman Marta Larra confirmed the boy's death, and said his illness started out like a flu infection and gradually got worse. The family was from Guatemala's arid eastern region of Chiquimula, Paniagua said.

Officials and migrant parents say people smugglers encourage them to take children on the lengthy journey north because it makes it easier for families to get into the United States.

Reuters pictures published on Wednesday show adults and children outside the U.S. Border Patrol station for migrants in McAllen, Texas, sleeping on the ground and rigging up makeshift awnings with reflective blankets to shelter from the sun.

(Reporting by Sofia Menchu in Washington; Additional reporting by Kristina Cooke in San Francisco; Editing by Clarence Fernandez)