UN human rights chief Michelle Bachelet is "appalled" at the conditions in which the United States is keeping detained migrants and refugees, including children, her office said in a statement on Monday.

"As a pediatrician, but also as a mother and a former head of state, I am deeply shocked that children are forced to sleep on the floor in overcrowded facilities, without access to adequate health care or food, and with poor sanitation conditions," the statement quoted Bachelet as saying.

U.S. President Donald Trump has made a hardline immigration stance a key issue of his presidency and 2020 re-election bid.

Democratic lawmakers and civil rights activists who have visited migrant detention centres along the U.S.-Mexican border have described nightmarish conditions marked by overcrowding and inadequate access to food, water and other basic needs.

Last week the Department of Homeland Security's inspector general published photos of migrant-holding centres in Texas' Rio Grande Valley crammed with twice as many people as they were meant to hold.

"In most of these cases, the migrants and refugees have embarked on perilous journeys with their children in search of protection and dignity and away from violence and hunger," Bachelet said.

"When they finally believe they have arrived in safety, they may find themselves separated from their loved ones and locked in undignified conditions. This should never happen anywhere."

Deprivation of liberty of adults should be a measure of last resort, and should be for the shortest period possible with legal safeguards and in conditions meeting international human rights standards, said Bachelet, the former president of Chile.

Detaining a child for even short periods under good conditions could have a serious impact on their health and development, she added.

"Border management … should not be based on narrow policies aimed only at detecting, detaining and expeditiously deporting irregular migrants,"she said.

Last year, after it was clear the administration was separating children from adults who crossed into the U.S. between ports of entry, the UN human rights office criticized the policy, stating "children should never be detained for reasons related to their or their parents' migration status."