GENEVA (Reuters) - The United Nations called on the Trump administration on Friday to overhaul its migration policies and find alternatives to detention, saying that migrant children and their parents should not be treated like criminals.

Immigrant children walk in single file between tents in their compound next to the Mexican border in Tornillo, Texas June 18, 2018. REUTERS/Mike Blake

The United States has faced fierce criticism for separating more than 2,300 children from their families in order to prosecute their parents for crossing the border from Mexico illegally.

President Donald Trump backed down on Wednesday, signing an executive order to keep families together in detention during immigration proceedings.

“While we acknowledge the U.S. government’s decision not to continue separating children from their parents, we understand that the practice now will be to detain the children with their parents,” U.N. human rights spokeswoman Ravina Shamdasani told a Geneva briefing.

“We have said time and again the children should never be detained in relation to their or their parents’ migration status. It is never in the best interests of the child for them to be detained,” she added.

Video footage of children sitting in cages and an audiotape of wailing children sparked worldwide anger.

Trump suggested on Friday that some of the wrenching tales that have emerged from the border were fabricated by Democrats before congressional elections in November. “We cannot allow our Country to be overrun by illegal immigrants as the Democrats tell their phony stories of sadness and grief, hoping it will help them in the elections,” he tweeted.

The U.S. military has been asked to get ready to house up to 20,000 immigrant children, U.S. officials said on Thursday.

Shamdasani, asked about the prospect of using military bases, replied: “Irregular migration should not be a criminal offence, these people should not be treated as criminals.”

The U.N. Children’s Fund (UNICEF) also said it opposes detention of children and separation of families, while backing alternatives to custody.

“We believe that there are 100 countries that detain children for purposes of migration control,” spokesman Christophe Boulierac said, adding that the agency was working with governments to change their practices.

“You can have guarantees, people who guarantee the fact that the child will appear in the immigration courts. There is a range of technical mechanisms which work well, the children and the family do not escape and therefore we can avoid detention and separation,” he said.