LOS ANGELES A federal judge has ruled that the U.S. Department of Justice’s current system of detaining children with their mothers after they have crossed the U.S.-Mexico border violates an 18-year-old court settlement.The decision Friday by U.S. District Judge Dolly Gee in California is a victory for the immigrant rights lawyers who brought the case, but its immediate implications for detainees were not yet clear. The ruling upholds a tentative decision Gee made in April, and comes a week after the two sides told her that they failed to reach a new settlement agreement as she had requested.The 1997 settlement at issue bars immigrant children from being held in unlicensed, secure facilities. Gee found that settlement covered all children in the custody of federal immigration officials, even those being held with a parent.Peter Schey, executive director of the Center for Human Rights and one of the attorneys who brought the lawsuit, said federal officials “know they’re in violation of the law.””They are holding children in unsafe facilities. It’s that simple,” Schey told The Associated Press. “It’s intolerable, it’s in humane, and it needs to end — and end sooner rather than later.”Justice Department spokeswoman Nicole Navas said Saturday that her agency was reviewing the order.The new lawsuit was brought on by new major detention centers for women and children in Texas that are overseen by the U.S. government but are managed by private prison operators. Together, the centers have recently held more than 2,000 women and children between them after a surge of tens of thousands of immigrants from Central America, most of them mothers with children, many of whom said they were fleeing gang and domestic violence back home.The Justice Department had argued it was necessary to modify the settlement and use detention to try to deter more immigrants from coming to the border after last year’s surge. The department said it was an important way to keep families together while their immigration cases were being reviewed, but the judge rejected that argument in Friday’s decision.Gee gave the Department of Justice one week to show cause why she should not enter an injunction that would require the government to comply with the ruling within 90 days.But since the tentative ruling in April, Immigration and Customs Enforcement has vowed to make the facilities more child-friendly and provide better oversight.