The order, which Trump signed Wednesday, directs the Department of Homeland Security to keep families intact when they are caught crossing the border. However, it seeks to allow families to be detained together throughout the duration of their court proceedings.

"The administration's idea of a solution to a problem it caused is to keep children jailed indefinitely alongside their parents," Rep. Pete Aguilar, D-Calif., told McClatchy. "Because immigration courts are flooded, cases can take months or years to adjudicate. It is immoral to lock up children for an undetermined amount of time while families wait through a drawn-out legal process."

Trump's decision to sign an executive order to end the separation of children from their parents at the border comes after his administration began enforcing a new zero tolerance policy that calls for prosecuting all adults who crosses the border illegally. Children are separated from their parents, held in separate facilities and then sent to a shelter and eventually to stay with sponsors. The separation of children from parents has led to bipartisan protest across the United States and Congress as images of children in cages and sounds of crying babies dominated the news and social media.

"So we're going to have strong, very strong borders, but we're going to keep the families together," Trump said Wednesday when signing the order. "I didn't like the sight or the feeling of families being separated."

Wednesday's order leaves several unanswered questions: What happens to the more than 2,000 children already separated from their parents since April? Where will the families be housed? What happens after 20 days, the limit a court settlement currently allows for children to be detained?

The House is scheduled to vote on a broader immigration package Thursday that also would allow the indefinite detention of immigrant families. Democrats are expected to vote against the bill but many Republicans, including a group of moderate lawmakers, are expected to vote for the bill. It is not clear if the bill will pass.

It's unclear how long it will take for Trump's order to be implemented. In order to hold families together indefinitely, it directs Attorney General Jeff Sessions to try to modify a 1997 court agreement, known as the Flores settlement, that prohibits the federal government from keeping children, even with their parent, in immigration detention for more than 20 days.

Hamilton said the order takes effect immediately, but Homeland Security and the Department of Health and Human Services can decide when to implement it.

He could not say what happens to all the children already separated from parents.

It also allows the Department of Homeland Security to separate children from parents if they believe the child may be in danger.

Leon Fresco, a deputy assistant attorney general under President Barack Obama, who defended that administration's use of family detention, said the administration must decide in what order they're going to implement the terms of the executive order.

"Are they going ask for permission or seek forgiveness?" he said. "If they detain first, they're going to ask for forgiveness. If they're going to go to the court first, they're asking for permission."

He said there is nothing wrong with the administration seeking to modify the Flores settlement, but expects it will fail.

"Children should not be separated from their parents who are seeking asylum - but neither can the answer be the indefinite jailing of these children with their parents," said Todd Schulte, president of FWD.us, a pro-business group created by Facebook founder Mark Zuckerberg to work on immigration issues. "We reject this false choice."

Family detention surged during Obama's term when a surge of Salvadoran, Honduran and Guatemalan immigrants raced into the Rio Grande Valley in Texas, fleeing violence and poverty, leading the Department of Homeland Security to significantly increase its capacity to house families.

Immigration and Customs Enforcement argued that family residential centers were an effective and humane alternative by keeping families together as they awaited their immigration hearings or are deported. But immigrants complained of poor conditions and isolation at the centers.

"The idea that the way to end family separation is to indefinitely jail kids with their parents in family gulags at the border is as morally reprehensible as separating kids from their parents," said Frank Sharry, executive director of America's Voice, an immigration advocacy group.