Moving to contain a massive political and public relations backlash, President Donald Trump signed an executive order Wednesday to reverse a legally mandated policy of separating illegal immigrants at the border from their children.

Since the so-called zero-tolerance policy took effect in April, roughly 2,300 children apprehended with adults by U.S. Border Patrol officers have been sent to facilities run by the Department of Health and Human Services (HHS) while the adults remained jailed, facing criminal charges.

The policy proved wildly unpopular, however. Trump sought to strike a balance by instructing government authorities to keep parents and children together while their criminal cases remain active. The order also directs the Department of Defense (DOD) to identify military facilities where families can be housed temporarily.

“Anybody with a heart would feel very strongly about it,” Trump said from the Resolute Desk in the Oval Office. “At the same time, we don’t want to see people coming into our country illegally. This solves the problem.”

Trump said he would not back away from his administration’s drive to prosecute foreigners who come across the border without authorization.

“It continues to be a zero tolerance,” he said. “We have zero tolerance for people who enter the country illegally.”

Democrats said they were pleased that parents and children can stay together but were in no mood to give him any credit for solving a problem they contend he created.

“But let’s not give him a medal for starting the fire and then bringing a firehose,” Rep. Eric Swalwell (D-Calif.) told CNN’s Wolf Blitzer. “The best thing we can do is to stay loud as American citizens, because I think that is what moved him to do the right thing.”

Swalwell also called for the scalps of Department Homeland Security (DHS) Secretary Kirstjen Nielsen and other Trump administration officials who had a hand in drafting the zero-tolerance policy.

“Anyone involved in this should resign, including Attorney General Jeff Sessions,” he said. “They have inhumanely led their departments in ways that are un-American, that are cruel, and are being condemned from our churches to other countries. That’s embarrassing, Wolf.”

Who do you think would win the Presidency?

By completing the poll, you agree to receive emails from LifeZette, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

Related: Four Immigration Facts Mainstream Media Won’t Tell You

But others who had called for an end to the policy praised Trump.

Family Research Council (FRC) President Tony Perkins noted that he led a delegation of ministers and pastors Tuesday to discuss the issue with Sessions.

“If there is a silver lining, all this has brought much-needed attention to the immigration issue,” he said in a statement. “I am hopeful that all sides may finally come to the table and negotiate a solution.”

PoliZette senior writer Brendan Kirby can be reached at [email protected]. Follow him on Twitter.