The federal government told a panel of Ninth Circuit appellate judges last week that US border detention facilities are "safe and sanitary," as required by law, even though migrant children are denied soap, toothbrushes and dark places to sleep.

Judge William Fletcher called the position of Sarah Fabian, a senior attorney from the Office of Immigration Litigation, "inconceivable."

Senior US Circuit Judge A Wallace Tashima told the government attorney, "If you don't have a toothbrush, if you don't have soap, if you don't have a blanket, it's not safe and sanitary."

Ms Fabian's argument spread rapidly across the internet - and so did several tweets supporting the notion that the United States treats migrant detainees less humanely than foreign pirates and the Taliban treat their captives.

American journalist Michael Scott Moore, abducted in 2012 while reporting in Somalia, watched Ms Fabian argue that minimal necessities, like toiletries and sleeping conditions, were not essential to meet minimum "safe and sanitary" standards.

Undocumented immigration across the US-Mexico border Show all 14 1 /14 Undocumented immigration across the US-Mexico border Undocumented immigration across the US-Mexico border Immigrant children, many of whom are separated form their parents, are housed in Texas' tent city Reuters Undocumented immigration across the US-Mexico border A two-year-old Honduran asylum seeker cries as her mother is searched and detained near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Undocumented migrants ride on the top of a freight train referred to as the beast, or La Bestia Getty Undocumented immigration across the US-Mexico border A cage inside a US Customs and Border Protection detention facility in Texas Reuters Undocumented immigration across the US-Mexico border US Border Patrol Academy All new agents must complete a months-long training course at the New Mexico facility before assuming their posts at Border Patrol stations, mostly along the US-Mexico border Getty Undocumented immigration across the US-Mexico border US-Mexico border fence A group of young men walk along the Mexican side of the US-Mexico border fence in a remote area of the Sonoran Desert Getty Undocumented immigration across the US-Mexico border US-Mexico border fence in the US Man looks through US-Mexico border fence into the US in Tijuana, Mexico Getty Undocumented immigration across the US-Mexico border US-Mexico border fence US Border Patrol agent Sal De Leon stands near a section of the US-Mexico border fence while stopping on patrol on in La Joya, Texas Getty Undocumented immigration across the US-Mexico border US Border Patrol Academy US Border Patrol instructor yells at trainees after their initial arrival to the academy Getty Undocumented immigration across the US-Mexico border Memorial service in Guatemala Families attend a memorial service for two boys who were kidnapped and killed in San Juan Sacatepequez, Guatemala. Crime drives emigration from Guatemala to the United States, as families seek refuge from the danger Getty Undocumented immigration across the US-Mexico border Arrests on the border Undocumented immigrants comfort each other after being caught by Border Patrol agents near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Detention holding facility A boy from Honduras watches a movie at a detention facility run by the US Border Patrol Getty Undocumented immigration across the US-Mexico border Mexican farm workers Mexican migrant workers harvest organic parsley at Grant Family Farms in Wellington, Colorado Getty Undocumented immigration across the US-Mexico border Mexican family in Arizona A Mexican immigrant family sits in the living room of their rented home in Tuscon, Arizona. The family that Arizona's new tough immigrant law had created a climate of fear in the immigrant community. Getty

"That was - let's say - below my experience in Somalia," he told The Washington Post on Tuesday of his more than two years in captivity.

"The conditions were about as miserable as you could imagine," he said, describing a barren and concrete prison house. Often there was no electricity, he said, "but we had certain minimum things that kept it from being completely wretched."

He said he was given toothpaste, soap, a daily shower and a foam mattress.

Recent reports have surfaced describing US border detainees held in cages of chain-link fencing, sleeping on concrete and covered with blankets made of aluminium foil, allegations that Customs and Border Protection officials dispute.

On Tuesday, the agency said that children in custody receive "continuous access to hygiene products and adequate food" while awaiting shelter placement.

The executive editor of the New Yorker, David Rhodes, contributed to the online conversation, too.

"The Taliban gave me toothpaste & soap," he wrote on Twitter, drawing from the seven months he spent as a hostage of the Taliban, a group known for abusing captives; the online thread of former prisoners has been liked nearly half a million times.

Washington Post Global opinions writer Jason Rezaian, who was held in Iranian custody for a year and a half and has an ongoing lawsuit against the Iranian government, also responded on Twitter.

"I felt if I didn't chime in, it would be the height of hypocrisy," Mr Rezaian told The Post on Tuesday, calling US treatment of children at the border misaligned with "what this country stands for."

"The government is treating them like they're statistics, 'the other' and not deserving of basic humanity."

From the first day in captivity, Mr Rezaian was permitted to shower regularly. He was also given a toothbrush and toothpaste. Mr Rezaian asked, "If we're going to treat the most vulnerable people this way, what does that say about our actual values?"

The case heard on Tuesday stems from a motion filed under the Obama administration. In part, it argued that Customs and Border Protection was holding children in detention facilities that were not "safe and sanitary," in violation of a 1997 precedent.

The Trump administration, however, opted to bring the appeal, asking the panel of three judges to condone current custody conditions.