President Trump Donald John TrumpBiden on Trump's refusal to commit to peaceful transfer of power: 'What country are we in?' Romney: 'Unthinkable and unacceptable' to not commit to peaceful transition of power Two Louisville police officers shot amid Breonna Taylor grand jury protests MORE on Wednesday signed an executive order intended to end family separations at the southern border, giving in to intense bipartisan pressure on an issue that had drawn worldwide condemnation of his administration.

Trump told reporters in the Oval Office before signing the document that his “zero tolerance” policy against illegal border crossing will remain in place, but that the order allows children and their parents to remain together in custody.

“We’re going to have strong, very strong borders, but we’re going to keep the families together,” Trump said. “I didn’t like the sight or the feeling of families being separated.”

ADVERTISEMENT

As he signed the order, Trump added: “You're going to have a lot of happy people.”

The decision marked a surprising reversal for Trump, who has falsely claimed for more than a week that his hands were tied by federal laws and court rulings from stopping the separation of families apprehended at the border.

“Congress and the courts created this problem, and Congress alone can fix it,” Homeland Security Secretary Kirstjen Nielsen Kirstjen Michele NielsenMore than million in DHS contracts awarded to firm of acting secretary's wife: report DHS IG won't investigate after watchdog said Wolf, Cuccinelli appointments violated law Appeals court sides with Trump over drawdown of immigrant protections MORE, who stood next to Trump at the Resolute Desk during Wednesday's signing, said earlier this week.

But the president decided to change course following days of blanket news coverage featuring images of young children, often in tears, being held in metal cages inside detention facilities near the U.S.-Mexico border.

Those images sparked an international outcry, which was amplified by Pope Francis, who called family separation “immoral.” Republican lawmakers criticized the practice as “cruel” and expressed concern the issue could hurt the party’s chances ahead of the November midterm elections.

The order calls on the Department of Homeland Security to keep families together while people await trial for illegal border crossing, except in cases where there is a concern that parents “would pose a risk to the child’s welfare.”

It also urges the Justice Department to expedite immigration cases involving families and asks the Pentagon to provide space on military installations to house families.

Trump’s order seems unlikely to completely solve the problem.

The document may violate a 1997 court settlement that sets the conditions for children who are apprehended crossing the border. Under rules stemming from that settlement, children who are accompanied by parents cannot be held in custody for more than 20 days.

Trump ordered Attorney General Jeff Sessions Jefferson (Jeff) Beauregard SessionsGOP set to release controversial Biden report Trump's policies on refugees are as simple as ABCs Ocasio-Cortez, Velázquez call for convention to decide Puerto Rico status MORE to request a change to the settlement that allows the government “to detain alien families together" for the duration of their legal proceedings for illegal entry, asylum or deportation.

Regardless, Trump’s order could face legal challenges from immigrant rights groups who say the 1997 settlement is crucial for protecting child welfare.

House Republicans are also trying to pass legislation that would resolve the family separation issue, while also funding Trump’s long-sought-after border wall and making cuts to legal immigration.

The measures, however, face an uphill battle for passage despite lobbying efforts by the administration. That included a trip to the White House by Speaker Paul Ryan Paul Davis RyanKenosha will be a good bellwether in 2020 At indoor rally, Pence says election runs through Wisconsin Juan Williams: Breaking down the debates MORE (R-Wis.) and GOP fence-sitters as well as a briefing for members at the Capitol by Nielsen.

Given that uncertainty, Trump was moved to act, according to a White House official who requested anonymity to describe his thinking.

First lady Melania Trump Melania TrumpTrump privately blamed Black Americans for lacking initiative: report The Hill's 12:30 Report: Ginsburg lies in repose Melania Trump: Ginsburg's 'spirit will live on in all she has inspired' MORE also played a role in changing the president’s mind.

Another White House official said the first lady “has been sharing her opinion with her husband for several days, feeling it important to do all he can to keep families together whether through legislative action or something on his own.”

Trump mentioned Melania Trump in his own comments, as well as the feelings of his eldest daughter, Ivanka Trump Ivana (Ivanka) Marie TrumpSpecial counsel investigating DeVos for potential Hatch Act violation: report Trump, Biden vie for Minnesota Trump luxury properties have charged US government .1M since inauguration: report MORE.

“Ivanka feels very strongly,” Trump said. “My wife feels very strongly about it. I feel very strongly about it. I think anybody with a heart would feel very strongly about it. We don't like to see families separated.”

The family separation crisis was sparked by the Trump administration’s decision in April to impose a “zero tolerance” policy that referred all illegal border crossers for criminal prosecution. Past administrations used discretion in deciding which cases to pursue.

That resulted in a dramatic uptick in adults who were placed in custody to await legal proceedings, while their children were sent to separate juvenile facilities because they cannot be held in custody with their parents.

The administration said this week that more than 2,300 children were separated from their families at the border during a five-week period ranging from May 5 to June 9.

Those figures, and the images of children, triggered a fury beginning last week.

“I live in a border state. I appreciate the need to enforce and protect our international boundaries, but this zero-tolerance policy is cruel. It is immoral. And it breaks my heart,” first lady Laura Bush wrote last week in The Washington Post.

She was later joined by the other three living former first ladies: Michelle Obama Michelle LeVaughn Robinson ObamaBlack stars reimagine 'Friends' to get out the vote Obama shares phone number to find out how Americans are planning to vote Michelle Obama: 'Don't listen to people who will say that somehow voting is rigged' MORE, Rosalynn Carter and Hillary Clinton Hillary Diane Rodham ClintonDemocratic groups using Bloomberg money to launch M in Spanish language ads in Florida The Hill's Campaign Report: Presidential polls tighten weeks out from Election Day More than 50 Latino faith leaders endorse Biden MORE, Trump’s 2016 campaign opponent.

Trump defended his policies despite that criticism, blaming everyone from members of Congress to the news media for the child separations.

“They could be murderers and thieves and so much else,” the president said Monday. “So we want a safe country, and it starts with the borders. And that's the way it is.”

The following day Trump tweeted that “Democrats are the problem” when it comes to illegal immigration because they want migrants “to pour into and infest our Country.”

That defiance fueled the outcry even more. A day after defending the policy during a televised briefing at the White House, Nielsen was confronted at a nearby Mexican restaurant by demonstrators who chanted “how do you sleep at night?" and “if kids don't eat in peace, you don't eat in peace."

The Wall Street Journal’s editorial board wrote that the policy could cost the GOP its congressional majorities, Trump supporter Franklin Graham called it a “disgrace” and Canadian Prime Minister Justin Trudeau said what was happening in the United States was “wrong.”