WASHINGTON - U.S. President Donald Trump on Wednesday backed down and abandoned his policy of separating immigrant children from their parents on the U.S.-Mexico border, after images of youngsters in cages sparked outrage at home and abroad.Trump signed an executive order requiring that immigrant families be detained together when they are caught entering the country illegally for as long as their criminal proceedings take.While the change may end a policy that drew a rebuke from Pope Francis and everyone else from human rights advocates to business leaders, it may also mean immigrant children remain in custody indefinitely.The Trump administration still faces legal challenges because of a court order that caps how long immigration authorities may detain minors, and trigger fresh criticism of Trump's hardline immigration policies, which were central to his 2016 election campaign and now his presidency.A Justice Department official was unable to clarify whether family separations would end immediately or when and how families now separated would be reunited.The Trump order, an unusual reversal by him, moves parents with children to the front of the line for immigration proceedings but it does not end a 10-week-old "zero tolerance" policy that calls for prosecution of immigrants crossing the border illegally under the country's criminal entry statute."It's about keeping families together while at the same time making sure that we have a very powerful, very strong border," Trump said as he signed the order in a hastily arranged Oval Office gathering.Video footage of children sitting in cages and an audiotape of wailing children had sparked anger as the images were broadcast worldwide.Governments from Central America and Mexico welcomed Trump's decision on Wednesday, but said they would remain vigilant to ensure the rights of their citizens were respected.An avid viewer of cable television news, Trump recognized that the family separation issue was a growing political problem, White House sources said.Trump's wife, Melania Trump, in private conversations with the president, urged him to do something to end the humanitarian crisis, a White House official said.In the Oval Office, Trump said he had also heard from his daughter and aide, Ivanka Trump, about the policy."Ivanka feels very strongly. My wife feels very strongly about it. I feel very strongly about it. I think anybody with a heart would feel very strongly about it," Trump said.Wednesday's move was the most significant policy reversal by Trump since he took office in January 2017. Instinctively combative and fond of chaos, Trump usually digs in on controversial policies, rather than backing down.He had tried to blame Democrats for the policy of separating children from parents and force them into concessions, including funding for a wall he wants to build along the border with Mexico. Just in the past few days he had insisted his hands were tied by law on the issue of family separations even though his administration implemented a "zero tolerance" policy.But the volume of condemnation on breaking up families, from inside and outside the White House, finally overwhelmed Trump.Gene Hamilton, counselor to U.S. 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.A federal appeals court has interpreted the Flores agreement to allow immigration officials to detain families for only 20 days. Any attempt by the government to modify the agreement would likely face opposition from the lawyers who negotiated it, according to representatives of immigrant rights organizations.They also said families facing lengthy detention under the new executive order will be able to sue the Trump administration outside of the Flores framework.Trump's reversal also creates a series of new headaches for the administration, as it wrestles with where to house families that are detained together, possibly for long periods, and how to reunite families that already have been separated."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,” Anthony Romero, executive director of the American Civil Liberties Union, said in a statement.Parents referred by border agents for prosecution are held in federal jails, while their children have remained in U.S. Customs and Border Protection custody or have been moved into facilities managed by the Office of Refugee Resettlement, a Department of Health and Human Services agency.U.S. Customs and Border Protection said on Tuesday that 2,342 children had been separated from their parents at the border between May 5 and June 9.Trump directed the Justice Department to seek a modification of a court order to permit families that enter the United States illegally to be detained together until their criminal proceedings are concluded, a text of the order shows.It also directs the Department of Defense to take steps to house detained immigrant families as needed.The Republican-controlled U.S. Congress is considering legislation to address the issue. The House of Representatives planned to vote on Thursday on two bills designed to halt family separations and address a range of other immigration issues.Republicans said they were uncertain if either House measure would have enough votes to pass. Trump told House Republicans on Tuesday night he would support either of the bills.Both House bills, which Democrats and immigration advocacy groups oppose, would fund Trump's proposed wall and reduce legal migration, in part by denying visas for some relatives of U.S. residents and citizens living abroad.The more conservative bill from Republican lawmaker Bob Goodlatte also would deny the chance of future citizenship to "Dreamers," who are immigrants brought illegally into the United States years ago as children.House Speaker Paul Ryan told reporters that compromise legislation under discussion would provide funding to allow the Department of Homeland Security enough resources to house and care for families as they stayed together during the process.