President Donald Trump has signed an executive order to keep migrant families together.
The US president ruled that families crossing the border will still be arrested and prosecuted, but they will be held together, rather than having the children taken away.
Signing the order, Mr Trump said: "I consider it to be a very important executive order. It's about keeping families together while at the same time being sure that we have a very powerful, very strong border, and border security will be equal if not greater than previously.
"So we're going to have strong, very strong borders, but we're going to keep the families together. I didn't like the sight or the feeling of families being separated."
He also asked the department of defence to assist with sheltering the families, given the current state of overcrowding.
And he said that Congress must seek to modify the Flores agreement - a 1997 ruling that meant that children cannot be held for more than 20 days.
"When an alien enters or attempts to enter the country anywhere else, that alien has committed at least the crime of improper entry and is subject to a fine or imprisonment under section 1325(a) of title 8, United States Code," the executive order reads.
"This Administration will initiate proceedings to enforce this and other criminal provisions of the INA until and unless Congress directs otherwise.
"It is also the policy of this Administration to maintain family unity, including by detaining alien families together where appropriate and consistent with law and available resources."
Ivanka Trump, the president's daughter, who has been strongly criticised for her silence on the issue - while all five first ladies spoke out - tweeted: "Thank you @POTUS for taking critical action ending family separation at our border. Congress must now act + find a lasting solution that is consistent with our shared values;the same values that so many come here seeking as they endeavor to create a better life for their families."
The signing of the executive order seeks to lower the temperature on what has become a furious political debate.
"We want to keep families together," Mr Trump said, speaking early on Wednesday at the White House.
Mr Trump said that he hoped the executive order would happen in parallel with legislation passed by Congress. The US House of Representatives is due to consider a bill on the issue on Thursday.
Hosting a round table of Republican senators and representatives, Mr Trump staged a televised 24-minute discussion of the issue.
"The dilemma is that if you’re weak, as some people would like you to be, if you are really, really pathetically weak, the country will be overrun with millions of people," he said.
"If you are strong, you don’t have any heart. And that’s a tough dilemma. Perhaps I’d rather be strong."
Mr Trump stressed that it was a long-running problem, and that he wanted a permanent solution. He told his colleagues - 15 men and one woman - that they should "not feel guilty" about the scenes at the border, but urged them to work for an answer.
"We're having a lot of problems with Democrats that don't want to vote for anything," he said.
"They don't care about lack of security. They really would like to have open borders where anybody in the world can just flow in, including from the Middle East, from anybody anywhere they can just flow into our country.
"Tremendous problems with that, tremendous crime caused by that. We're just not going to do it."
But in his hometown of New York, the mayor, Bill de Blasio, remained furious about the situation.
He held a press conference outside a Harlem housing shelter denouncing the fact that 239 children had been brought to his city without his knowledge, including a nine-month-old baby.
He only learnt of it after a local television station in New York received a tip off that children were arriving by night at a shelter in Harlem, and filmed the arrivals.
“How is it possible that none of us knew there were 239 children right here in our own city?” said Mr de Blasio.
“How is the federal government holding back that information from the people of this city and holding back the help these kids could need?”
He said the federal government would not tell city officials exactly how many children were sent to New York and where they were being housed.
“The federal government has not given us any information. We have asked for it,” he said.
Mr de Blasio said the children arriving in East Harlem need both mental health assistance and physical help — with some arriving with lice, bedbugs, chickenpox and other contagious illnesses.
Almost 2,000 children have been separated from their parents on the US-Mexico border since April, as a result of the adults being treated as criminal offenders. Before April they were classed as having committed a civil offence.
On Tuesday night Mr Trump met with Republicans in Congress, to discuss two possible immigration reform bills, due to be voted on on Thursday.
On Wednesday morning, however, Mr Trump once again blamed Congress and the Democrats for the situation.
“It’s the Democrats fault, they won’t give us the votes needed to pass good immigration legislation,” he tweeted.
“They want open borders, which breeds horrible crime. Republicans want security. But I am working on something - it never ends!”
The president also retweeted a tweet by Darrell Scott, a pastor and Trump supporter, that declared: “Once the mid terms are over, liberals won’t talk about detained or separated illegal immigrant children until 2020. #itsallpolitics.”
Miss Nielsen insisted that the 12,000 children currently in US government care - 10,000 of them arriving alone, and 2,000 being taken from their parents - were being treated well.
But the Center for Investigative Reporting on Wednesday highlighted that Jeff Sessions, the attorney general, was taken to court in April over the treatment of the youngsters. A further hearing will be held on June 29.
In the court documents, children held at Shiloh Treatment Center, a government contractor south of Houston that houses immigrant minors, alleged that they were held down and injected.
The lawsuit alleges that children were told they would not be released or see their parents unless they took medication, and that they were told they were receiving vitamins.
"The government does not contest that it is medicating these kids," said Carlos Holguin, the chief counsel for the LA-based Center for Human Rights.
He told The Telegraph that the government did try to argue that some of the children required medicating, but that that was not the issue at the heart of the case - which was whether the federal authorities had the right to do so.
The Shiloh Treatment Center did not respond to The Telegraph's request for comment