WASHINGTON — Bowing to pressure from anxious allies, President Donald Trump abruptly reversed himself Wednesday and signed an executive order halting his administration’s policy of separating children from their parents when they are detained illegally crossing the U.S. border.
It was a dramatic turnaround for Trump, who has been insisting, wrongly, that his administration had no choice but to separate families apprehended at the border because of federal law and a court decision.
The news in recent days has been dominated by searing images of children held in cages at border facilities, as well as audio recordings of young children crying for their parents — images that have sparked fury, questions of morality, and concern from Republicans about a negative impact on their races in November’s midterm elections.
Until Wednesday, the president, Homeland Security Secretary Kirstjen Nielsen, and other officials had repeatedly argued the only way to end the practice was for Congress to pass new legislation, while Democrats said Trump could do it with his signature alone. That’s just what he did.
‘‘We’re going to have strong, very strong borders, but we’re going to keep the families together,’’ said Trump who added that he didn’t like the ‘‘sight’’ or ‘‘feeling’’ of children separated from their parents.
The order does not end the ‘‘zero-tolerance’’ policy that criminally prosecutes all adults caught crossing the border illegally. It would keep families together while they are in custody, expedite their cases and ask the Department of Defense to help house them.
But under a previous class-action settlement that set policies for the treatment and release of minors caught at the border, families can only be detained for 20 days. A senior Justice Department official said that hasn’t changed.
‘‘This is a stopgap measure,’’ said Gene Hamilton, counsel to the attorney general. Justice lawyers were planning to file a challenge to the agreement, known as the Flores settlement, asking that a judge allow for the detention of families until criminal and removal proceedings are completed.
Hundreds of children wait in Border Patrol facility in Texas
So Trump’s order is likely to create a fresh set of problems and may well spark a new court fight. It’s unclear what happens if no changes to law or the settlement take place by the time families reach the detainment deadline. The language also leaves room to separate children from parents if it’s best for the child’s welfare.
Health and Human Services Secretary Alex Azar said his department will start reuniting detained immigrant children with their parents — but he’s making no specific commitment on how quickly that can be accomplished.
Assessments for possible detention facilities at military bases have already been done in Texas and another is expected in Arkansas on Thursday.
Trump’s family apparently played a role in his turnaround.
A White House official said first lady Melania Trump had been making her opinion known to the president for some time that she felt he needed to do all he could to help families stay together, whether by working with Congress or acting on his own.
And daughter Ivanka Trump tweeted, ‘‘Thank you @POTUS for taking critical action ending family separation at our border.’’
Homeland Security Secretary Nielsen briefed lawmakers on Capitol Hill Wednesday, and those on the fence over pending immigration legislation headed to the White House to meet with Trump.
Two people close to Nielsen said she was the driving force behind the turnabout that led to the new order keeping families together. Those people were not authorized to speak publicly and commented only on condition of anonymity.
One of them said Nielsen, who had become the face of the administration’s policy, had little faith that Congress would act to fix the separation issue and felt compelled to act. She was heckled at a restaurant Tuesday evening and has faced protesters at her home.
Trump had tweeted early Wednesday, before issuing his order, ‘‘It’s the Democrats fault, they won’t give us the votes needed to pass good immigration legislation. They want open borders, which breeds horrible crime. Republicans want security. But I am working on something - it never ends!’’
The ‘‘zero tolerance’’ policy put into place last month moves adults to the custody of the U.S. Marshals Service and sends many children to facilities run by the Department of Health and Human Services.
The policy had led to a spike in family separations in recent weeks, with more than 2,300 minors separated from their families at the border from May 5 through June 9, according to Homeland Security.
The Flores settlement, named for a teenage girl who brought the case in the 1980s, requires the government to release children from custody and to their parents, adult relatives or other caretakers, in order of preference. If those options are exhausted, authorities must find the ‘‘least restrictive’’ setting for a child who arrived without parents.
In 2015, a federal judge in Los Angeles expanded the terms of the settlement, ruling that it applies to children who are caught with their parents as well as to those who come to the U.S. alone. Other recent rulings, upheld on appeal, affirm the children’s rights to a bond hearing and require better conditions at the Border Patrol’s short-term holding facilities.
In 2016, the 9th U.S. Circuit Court of Appeals ruled that child migrants who came to the border with parents and were held in custody must be released. The decision did not state parents must be released. Neither, though, did it require parents to be kept in detention, apart from their children.
Under the Obama administration, such families were usually referred for civil deportation proceedings, not requiring separation. There currently are three family detention centers with a total 2,700-bed capacity.Associated Press writer Ken Thomas and Zeke Miller contributed to this report.