Follow CBSPHILLY Facebook  | Twitter

WASHINGTON (CBS/AP) — President Donald Trump signed an executive order on Wednesday to end family separations at the U.S.-Mexico border, just weeks after his administration took a hard line on asylum seekers crossing into the United States.

The crisis at the border gave way to public outcry as stories poured in about young children being taken from their parents.

Gov. John Carney Refuses To Send National Guard Troops To US Southwest Border

The order will immediately end the policy of separating children from their parents who are detained, by Trump made clear that it will not end his administration’s zero-tolerance policy for migrants illegally entering the U.S.

“We’re going to have a lot of happy people. This has been going on for 60 years — 60 years, nobody’s taken care of it. Nobody’s had the political courage to take care of it, but we’re going to take care of it. It’s been going on for a long time,” said Trump.

Under the Trump administration’s recent policy, more than 2,300 children have been separated from their parents since May. Images of children in government-run facilities triggered a firestorm of protests.

“It is psychological torture what this administration is doing,” said Rep. Joe Crowley, D-N.Y.

The president had repeatedly insisted that only Congress can fix the crisis, but in a meeting with congressional Republicans he announced his reversal.

“If you’re really, really pathetically weak, the country will be overrun with millions of people. If you’re strong, you don’t have any heart. That’s a tough dilemma,” said the president.

Sources tell CBS News the reversal surprised even the president’s closest advisers. After signing the executive order, he told reporters he was impacted by the images of children being separated from their families.

Earlier Wednesday, Trump continued blaming Democrats for the situation at the border.

“We’re having a lot of problems with Democrats, they don’t want to vote for anything. They don’t care about lack of security. They really would like to have open borders where anybody in the world can just flow in, including the Middle East,” said Trump.

House Speaker Paul Ryan says the House will vote on the immigration bill but offered no back-up plan if the measure fails. Ryan has stated he does not support separation of families.

Trump: ‘We’re Going To Be Guarding Our Border With The Military’

The children are put into the custody of the U.S. Department of Health and Human Services with the aim of keeping them as close to their parents as possible and reuniting the family after the case goes through the courts, said Steven Wagner, an acting assistant secretary at the Department of Health and Human Services.

In May, the Department of Justice adopted the zero-tolerance policy in which anyone caught entering the U.S. illegally is criminally prosecuted. Children can’t be jailed with their parents. Instead, after the adult is charged, children are held briefly by Homeland Security officials before being transferred to Health and Human Services, which operates more than 100 shelters for minors in 17 states.

The department has set up new facilities to manage the influx of children, and Wagner said they were prepared to expand as more children come into custody.

The children are classified as unaccompanied minors, a legal term generally used for children who cross the border alone and have a possible sponsor in the U.S. willing to care for them. Most of the more than 10,000 children in shelters under HHS care came to the U.S. alone and are waiting to be placed with family members living in the U.S.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press and CNN contributed to this report.)