President Trump’s executive order Wednesday would end his policy of separating children from their parents during immigration proceedings by confining them together in detention centers. Toward that end, he asked a federal judge to “modify” a 1997 settlement requiring prompt release of minors in immigration custody.

But the judge is not likely to do that, said a lawyer for the youngsters in the case that led to the settlement.

“Being inside a prison is just as traumatic, even with your mother,” said Holly Cooper, co-director of the Immigration Law Clinic at UC Davis. “They’re mischaracterizing that they have found a solution.”

The settlement was intended to reduce detention of youngsters, Cooper said, and “if they’re really seeking to create more family detention, then it’s very unlikely that they’re going to succeed.”

Jesse Hahnel, executive director of the National Center for Youth Law, which also represented the minors in the settlement, said he and his colleagues would consider any modifications the administration proposed, but “the executive order does not affect the constitutional rights of these children.”

Legal commentators noted that the 21-year-old settlement was agreed to by President Bill Clinton and remains binding on his successors, despite unsuccessful efforts by several administrations, most recently President Barack Obama’s, to lengthen the detentions it allows for minors.

Congress could probably take such an action by passing a law, but “the president cannot do that. He’s a party” to the settlement, said Bill Hing, a University of San Francisco law professor and director of the school’s Immigration and Deportation Defense Clinic.

The settlement resolved a class-action lawsuit by immigrants’-rights groups in 1985 on behalf of 15-year-old Jenny Flores, who had fled El Salvador and was held in detention after reaching the United States.

In 1997, a federal judge in Los Angeles approved the settlement requiring youngsters to be placed in the “least restrictive setting available” and released “without unnecessary delay” to a parent, adult relative or guardian. If none of those is available, the judge said they must be freed from confinement and placed with a licensed program that provides education and social services.

U.S. District Judge Dolly Gee, who now oversees the case, has ruled that minors must usually be freed in no more than 20 days. When the Obama administration sought to hold them in family detention centers for longer periods in response to a surge in migration from Central America, Gee declined to modify the settlement, and also ruled that it applied to minors who were brought to the U.S. by their parents as well as those who came alone. The Ninth U.S. Circuit Court of Appeals upheld her ruling in 2016.

In Wednesday’s executive order, Trump — whose recently declared policy requiring criminal prosecution of all unauthorized immigrants had led to the detention of more than 2,300 minors separated from their parents — declared that his administration’s policy is “to maintain family unity, including by detaining families together ... where appropriate and consistent with law and available resources.”

He directed Attorney General Jeff Sessions to ask Gee “to modify the settlement agreement” and allow the Department of Homeland Security, “under present resource constraints, to detain a family together” during the criminal prosecution or immigration court proceedings of any family member.

One attorney said Trump’s order, if carried out, wouldn’t actually require children and parents to be held in the same detention facility.

The language about “available resources” is a loophole that would allow immigration officials to house minors separately if they say they’ve run out of family housing, said Greg Siskind, a Tennessee immigration lawyer.

Despite the administration’s claim of “resource constraints” and other changed circumstances that justify modifying the settlement, Hing of USF said there’s been no new surge of immigrants since 2014, when the Obama administration tried to lengthen detentions for minors.

Trump’s case is “built on weak facts and figures,” and “I don’t think Dolly Gee will buy any of it,” said Hing, who is not involved in the Flores case.

An attorney in the case, Peter Schey of the Center for Human Rights and Constitutional Law, said he plans to ask Gee to rule that the current settlement bars needlessly separating minors from their parents, without keeping them in detention. He cited a provision requiring the government to treat the youngsters with “dignity, respect, and a special concern for their particular vulnerability as minors.”

Regarding Trump’s order, Rose Villazor, an immigration law professor at UC Davis, said the Ninth Circuit Court stated in its 2016 ruling that only a “significant change in the law” would justify rewriting the Flores settlement to lengthen confinement.

“There has been no change” in the law since then, she said. “The only change has been ‘zero tolerance,’” the Trump administration’s declared policy of criminally prosecuting everyone accused of entering the country illegally.

CNN reported that a Justice Department official seemed to acknowledge that the administration will have to persuade Gee to change the settlement.

“The result of this decision and this ruling has placed the executive branch in an untenable position. Do we catch and release every alien who comes with a child across our Southwest border, or do we release (them)?” CNN quoted Gene Hamilton, counselor to the attorney general, as saying. “It’s on the judge, it’s on Judge Gee to render a decision here. ...The simple fact of the matter is Judge Gee has put the executive branch into an untenable position, that’s why we’re seeking for Congress to make a permanent fix.”

Another federal judge, Robert Kelleher, an appointee of President Richard Nixon, approved the original settlement in 1997. Gee, appointed by Obama, took over the case after Kelleher's death in 2012.

Gee will most likely rely on the 2016 ruling when she refuses to alter the settlement, Villazor said, and the president “could then try to blame Democrats for not passing a law.”

Bob Egelko and Hamed Aleaziz are San Francisco Chronicle staff writers. Email: begelko@sfchronicle.com; haleaziz@sfchronicle.com Twitter: @BobEgelko; @haleaziz