President Trump on Wednesday signed an executive order to end his own administration's policy of forcibly separating families at the U.S. border.

Trump, however, said his order would not end the broader "zero-tolerance" policy that criminally prosecutes all adults caught crossing the border illegally. Instead, the order directs the Department of Homeland of Security to keep families detained together, contingent on a judge altering a 1997 settlement that places strict limits on the government's ability to detain children.

As Buzzfeed reports:

Any long-term enforcement of the order is contingent on a judge approving changes to a 1997 settlement agreement that restricts the detention of children. The administration can detain families together for up to 20 days — a deadline based on earlier court rulings interpreting the 1997 settlement — but then will have to separate them absent action by a judge or Congress.

Trump's order directs Attorney General Jeff Sessions to file a request with the federal judge in California overseeing the 1997 settlement, known as the Flores Settlement Agreement, to ask for changes that would allow DHS to detain families for as long as their cases are pending, as spelled out in the executive order. Until the judge approves any changes, the government cannot hold children in facilities that don't meet the standards spelled out in the settlement past 20 days.

"Trump has neither backed down nor relented here," Matthew Miller, a justice and security analyst for MSNBC, wrote on Twitter. "Detaining children with their families is better than detaining them separately, but it was not the status quo before his new policy and we shouldn't pretend so."

The executive order also instructs the Department of Defense to make space and housing available to detain families, and authorizes the construction of new facilities.

The full text of the executive order is available here.

>> READ MORE: 'Toddlers detained': Rachel Maddow ends her show in tears, Corey Lewandowski mocks disabled migrant girl

Trump's decision was an abrupt turnaround after his administration spent the past few days defending the policy which has led to more than 2,300 children — some of them infants — being separated from their families at the U.S. border with Mexico and reclassified as unaccompanied minors, according to the Department of Homeland Security.

Trump and officials like Nielsen falsely repeated for days that only Congress had the power to end the administration's policy, which has faced increasing criticism from both Republicans and Democrats. Trump himself said on Fox News Friday morning, "We can't do it through an executive order."

>> READ MORE: Why I protested: 10 stories from Philly's rally against family separation

Here is a recap of the reaction Wednesday:

Philly officials honor World Refugee Day

Miriam Enriquez, executive director of the city’s Office of Immigrant Affairs, speaks at City Hall to honor World Refugee Day
MAGGIE LOESCH / Staff Photographer
Miriam Enriquez, executive director of the city’s Office of Immigrant Affairs, speaks at City Hall to honor World Refugee Day

Mayor Kenney called Philadelphia a welcoming city as he spoke outside City Hall about World Refugee Day, which was recognized internationally Wednesday.

Kenney had emphasized that same message earlier this month, when a federal judge ruled for Philadelphia in its highly contentious "sanctuary city" case against the Trump administration. The judge said the city's refusal to help enforce immigration laws was based on policies that are reasonable, rational and equitable.

Ivanka Trump thanks father for ending policy his administration started

Her tweet led to some criticism, including from former Obama adviser Dan Pfeiffer, who tweeted in response: "YOU DON'T THANK THE KIDNAPPER FOR RELEASING THE HOSTAGES."

Trump administration changed its story on the family-separation policy numerous times

How many? No fewer than 14 times, according to the Washington Post.

Among the administration's repeated falsehoods: That Democrats were responsible for the separation of families (it was the Trump administration's policy). That existing laws required family separation (they do not). And that Trump could not issue an executive order to address the issue (he did Wednesday).

Sen. Bob Casey calls move ‘overdue’ but says more must be done

"It is long overdue for President Trump to amend the most egregious element of his cruel and inhumane policy of ripping migrant children from their parents," Casey (D., Pa.) said in a statement Wednesday afternoon. "But substituting a lesser form of cruelty for a greater form is still cruelty."

Casey added that family detention "is far from the only or best solution for the majority of families at the border."

The immigrant rights nonprofit Juntos, based in South Philadelphia, echoed those thoughts.

"Detaining families together is not a valid solution to family separation," the group said in a statement. "People seeking refuge do not deserve to be met with chain link fences and trauma. Children should not be growing up in jail cells."

Former President Obama: ‘We have to do more’

Former President Barack Obama broke his silence on the situation at the border in a lengthy Facebook post Wednesday celebrating World Refugee Day.

"If you've been fortunate enough to have been born in America, imagine for a moment if circumstance had placed you somewhere else. Imagine if you'd been born in a country where you grew up fearing for your life, and eventually the lives of your children," Obama wrote. "Our ability to imagine ourselves in the shoes of others, to say 'there but for the grace of God go I,' is part of what makes us human. And to find a way to welcome the refugee and the immigrant… is part of what makes us American."

Obama concluded his post by saying our country's legacy of immigration is "something we have to protect for the generations to come. But we have to do more than say 'this isn't who we are.' We have to prove it — through our policies, our laws, our actions, and our votes."

Today is World Refugee Day. If you've been fortunate enough to have been born in America, imagine for a moment if…

Posted by Barack Obama on Wednesday, June 20, 2018

Airlines to Trump: Don’t fly separated kids on our airplanes

American, United and Frontier Airlines all issued statements on Wednesday condemning the separation of migrant children at the border, and told the Trump administration to stop using their airplanes to transport those kids across the country.

"We have no desire to be associated with separating families, or worse, to profit from it," American Airlines, the main carrier at Philadelphia International Airport, said in a statement, "We have every expectation the government will comply with our request and we thank them for doing so."

Department of Homeland Security Press Secretary Tyler Houlton blasted the airlines' requests in a series of tweets, claiming they were "buckling to a false media narrative" and that their decision "exacerbates the problems at our border and puts more children at risk from traffickers."

Executive order could create legal problem

If Trump issues an executive order allowing families to remain together, it could create a legal problem for his administration, according to CNN legal reporter Ariane de Vogue.

"Indefinite detention of minors would violated the Flores Settlement because it requires release to the "least restrictive environment" within 20 days," de Vogue wrote. "If the President acts, it will be challenged immediately."

An administration official with knowledge of the plan told the Washington Post the Trump administration was preparing to litigate the Flores, an agreement that places strict limits on the government's ability to detain children, especially if lawmakers on Capitol Hill fail to pass a legislative fix.

Paul Ryan: House will vote Thursday

House Speaker Paul Ryan told reporters that the House would vote on new immigration legislation on Thursday that would end the Trump administration's practice of separating children from parents who cross the Mexican border illegally.

Ryan said that under the Republican bill, "families will remain together under DHS custody throughout the length of their legal proceedings." He also said the legislation would solve the problem facing "Dreamers," undocumented immigrants brought into the country as children, "in a very elegant way."

Ryan did not provide any specific details about the legislation.

What local officials and residents had said about the policy

The shift comes a day after hundreds of protesters had gathered at Rittenhouse Square Tuesday while Vice President Pence attended a nearby fundraiser, to protest the family-separation policy. The demonstrators lined up children's shoes to represent those held in detention facilities.

Pennsylvania Gov. Tom Wolf, New Jersey Gov. Phil Murphy and Delaware Gov. John Carney all voiced their opposition toward sending members of their states' National Guard to the U.S. border because of the policy. Carney said he had refused a request to send troops.

The Associated Press contributed to this story.