"We're going to have strong - very strong - borders, but we are going to keep the families together", Trump said moments before signing the order at a White House event.
Some Democrats in Congress called for Homeland Security Secretary Kirstjen Nielsen to resign.
Trump said he did not like "the sight or the feeling" of the separations that have stirred widespread opposition to his administration's practice.
The administration's move comes after withering criticism for its heavy-handed and cold-hearted response to an immigration crisis following the implementation of its zero-tolerance policy that has resulted in children being forcibly separated from Central and South American parents who illegally cross the border.
While the President reversed course after days of digging in, finding a balance between enforcement of United States immigration laws and maintaining family unity will lead to many unknowns.
The family separations, highlighted by videos of youngsters detained in cages and an audiotape of wailing children, have sparked an outcry at home and strong condemnation overseas.
Die-hard Trump supporters remained steadfast, even as heart-rending photos of children held in cages and audio of terrified children crying out for their parents stoked outrage among Democrats and Republicans alike. That's just what he did.
"I don't think they have figured out what the legal consequences might be of trying to keep the parents together with the children indefinitely", said Representative Carlos Curbelo, a member of Trump's Republican party, after the meeting.
In a day of confusion and conflicting reports, the Trump administration began drawing up plans to house as many as 20,000 migrants on US military bases.
Gene Hamilton, counselor to US Attorney General Jeff Sessions, told reporters the Justice Department will seek changes to a 1997 settlement known as the Flores agreement, which set nationwide policy for the detention of minors in the custody of immigration officials.
World hits back at Trump over trade fight
Trump ran for the presidency on a vow to topple seven decades of American policy that had favored ever-freer trade among nations. EU countertariffs on a list of U.S. products would come into force on Friday, the European Commission said Wednesday.
TIME Unveils Cover Of July Issue, Focuses On Immigration In US
He also said that he was employed: "I thank God that I have a good job here". "I am waiting to see what happens with them". The magazine refuted his story, saying that's not how it chooses people.
USA to pull out of United Nations rights council
Haley has warned the council a year ago that the United States would withdraw from the council if changes were not made. In her speech, the United States diplomat accused a number of nations of impeding the UN Human Rights Council reform.
It is unclear how long this will take to litigate or whether the judges would be willing to permit indefinite detention of minors.
What else did Trump order? As many as 60 of these unaccompanied minors can be in the system in OR at any one time. Then he reversed course and said he would back the compromise - as well as a more conservative measure that went down to defeat earlier Thursday. It also moves parents with children to the front of the line for immigration proceedings.
"Make no mistake: The president is doubling down on his "zero tolerance" policy", said Senator Dick Durbin of IL, the chamber's second-ranking Democrat, in a statement.
Trump's family apparently played a role in his turnaround. Officials have said they are working to reunite families but have provided no clear answers on how.
Two people close to Nielsen said she was the driving force behind the turnabout that led to the new order keeping families together.
The president also attempted to blame Democrats for his practice, but they and several prominent Republicans were adamant that the administration could easily halt its action independent of outside action, which Trump eventually did. She was heckled at a restaurant Tuesday evening and has faced protesters at her home.
According to government figures, more than 2,300 minors separated from their families after illegally crossing the USA southern border with Mexico from May 5 through June 9. Under law, children entering the U.S. alongside adults fall under the Office of Refugee Resettlement's care while those criminal cases are pursued. If those options are exhausted, authorities must find the "least restrictive" setting for a child who arrived without parents. The settlement was later modified to say that children should not be held longer than 20 days.
In 2015, a federal judge in Los Angeles expanded the terms of the settlement, ruling that it applies to children who are caught with their parents as well as to those who come to the US alone.
The U.S. Office of Refugee Resettlement is responsible for placing thousands of teenage migrants apprehended at the border after they showed up at the crossing unaccompanied by a parent or adult.