President Donald Trump on Wednesday signed an executive order ending his administration’s controversial policy of separating families at the U.S. border with Mexico.

“We are keeping families together,” the president said as he signed the order while seated at the Resolute desk in the Oval Office. He was flanked by Vice President Mike Pence and Homeland Security Secretary Kirstjen Nielsen during the signing, and did not make reference to the actual text of the document.

He did, however, say the administration’s “zero tolerance” policy on illegal immigration will continue.

The order directs the secretary of Homeland Security to keep alien families together during the pendency of any criminal improper entry or immigration proceedings “to extent permitted by law and subject to the availability of appropriations, involving their members.”

“The Secretary shall not, however, detain an alien family together when there is a concern that detention of an alien child with the child’s alien parent would pose a risk to the child’s welfare,” the order says.

Defense Secretary Jim Mattis said the Pentagon will “respond if requested” to house migrants detained after crossing the U.S.-Mexico border illegally.

When a reporter noted that federal agencies have assessed four military bases for potential use as temporary housing for detained migrants, including unaccompanied children, Mattis said the Pentagon will “support whatever” the Department of Homeland Security says it needs. In the meantime, he said, this is not a matter for the Pentagon to comment on.

Despite the about face on separations, administration continues to maintain through the order that it will “rigorously enforce our immigration laws.

“Under our laws, the only legal way for an alien to enter this country is at a designated port of entry at an appropriate time,” it says. “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.”

Consistent with the position the president has espoused in recent days, the order says “it is unfortunate that Congress’s failure to act and court orders have put the Administration in the position of separating alien families to effectively enforce the law.”

The signing — a bit of theatrics as Trump could have rescinded the separation policy with a phone call — capped a hectic 24 hours for Trump and the officials who were enforcing the separation policy.

The Associated Press reported that Department of Homeland Security Secretary Kirstjen Nielsen spent an entire day drafting the executive order for Trump to sign.

On Wednesday morning the president declared “we want to solve this immigration problem,” while also canceling a previously scheduled annual picnic for lawmakers because it didn’t “feel right” to hold the event with Washington embroiled in the immigration controversy.

“We’re looking to keep families together. Very important. We’re going to be signing an executive order,” he said. “We are also going to count on Congress, obviously, but we are signing an executive order in a little while. We’re going to keep families together but we still have to maintain toughness or our country will be overrun by people, by crime, by all of the things that we don’t stand for and that we don’t want.”

But even as he signaled a change in course is coming on the separation of migrant families, the president already appeared to be doing some damage control.

“So I’m going to be signing an executive order in a little while before I go to Minnesota but, at the same time, I think you have to understand, we’re keeping families together but we have to keep our borders strong. We will be overrun with crime and with people that should not be in our country,” he said.

The White House has been the focus of a sustained outcry and widespread condemnation in recent days over its policy of separating children from parents who illegally cross the border.

In response, the president repeatedly derided Democrats on Twitter, falsely asserting that congressional Democrats were to blame for the situation.

“It’s the Democrats fault, they won’t give us the votes needed to pass good immigration legislation,” Trump tweeted Wednesday morning. “They want open borders, which breeds horrible crime. Republicans want security. But I am working on something – it never ends!”

The president also slammed the media on Wednesday morning for their coverage of family separations at the border.

“The Fake News is not mentioning the safety and security of our Country when talking about illegal immigration,” he tweeted. “Our immigration laws are the weakest and worst anywhere in the world, and the Dems will do anything not to change them & to obstruct want open borders which means crime!”

American Civil Liberties Union executive director Anthony Romero said Trump’s about-face on family separation wasn’t prompted by compassion but was the result of increasing scrutiny and negative backlash.

“Kids should not have been separated from their parents in the first place and they still don’t belong in jail. His alleged solution to a crisis of his own making is many months too late. It is a crisis that should not have happened to begin with. He has caused irreparable damage to thousands of immigrant families,” Romero said in a statement Wednesday.

“The devil is in the details. This crisis will not abate until each and every single child is reunited with his or her parent. An eleventh-hour executive order doesn’t fix the calamitous harm done to thousands of children and their parents. This executive order would replace one crisis for another. Children don’t belong in jail at all, even with their parents, under any set of circumstances. If the president thinks placing families in jail indefinitely is what people have been asking for, he is grossly mistaken.”

Very little of the conversation around immigration policy in the U.S has focused on the impact that immigrants and refugees have on the nation’s economy.

In Europe, a study by the Paris School of Economics found that asylum seekers fleeing to Western Europe nations to escape war-ridden areas provide an economic boost to their host countries economies.

The study analyzed 30 years worth of economic and migration data.

While asylum seekers take longer than migrants to have a positive effect on host nations’ economies, they still positively affect the economies they enter by contributing more in tax revenues than they draw from public spending, the study said.

The report found that asylum seekers significantly increased per-capita gross domestic product, reduced unemployment and improved public finance balances.