SAN DIEGO — A federal judge on Friday called on the U.S. government and the American Civil Liberties Union to come up with a plan to address the rights of parents and children separated at the U.S.-Mexico border to seek asylum.

The request was made during a hearing a day after U.S. District Judge Dana Sabraw extended a freeze on deportations of recently reunified families, giving a reprieve to hundreds of children and their parents who want to remain in the United States.

Sabraw wrote in issuing the order that "hasty removal of these children and their parents at the expense of an ordered process provided by law" would go against the public's interest and deprive the minors of their right to seek asylum.

During Friday's hearing, Sabraw asked the two sides to come to an agreement over whether some parents who were deported without their children should be returned to the U.S. to pursue asylum with the minors.

Lee Gelernt, an ACLU attorney representing separated families, said some deported parents should be allowed to return to accompany their children through the asylum process. He told the judge others should be let back in because they were misled into believing that if they agreed to be deported, they would be reunited with their children.

As many as 366 parents who were deported to their homelands have not yet been reunited with their children. Sabraw asked the government to provide a detailed report next week on the progress of its efforts to reunify those families.

The government has opposed delaying deportations, saying parents waived the rights of their children to pursue asylum claims after the adults signed deportation forms.

The order to extend the freeze, which Sabraw first put in place July 16, affects many of the more than 2,500 children who were separated from their parents.

Sabraw said delaying the deportations "would not unfairly or unduly tax available government resources."

He said claims of people persecuted in their homelands should at least be heard as they seek asylum. Many families have said they were fleeing violence in their home countries in Central America and planned to seek asylum.

"The court is upholding the rights provided to all persons under the United States Constitution, rights that are particularly important to minor children seeking refuge through asylum," Sabraw wrote.

In late June, Sabraw ordered that children under 5 be rejoined with their parents in 14 days and children 5 and older be rejoined in 30 days.

The order came days after President Donald Trump, amid public outrage about children being taken from their parents, halted the "zero-tolerance" policy implemented in the spring that split up families at the border.

The government so far has reunified at least 2,089 children with their parents or others, including sponsors. More than 560 were still separated.