A California federal judge has ordered a the reunification of all families that have been separated at the US border in the first major ruling to rebuke the Trump administration's "zero tolerance" immigration policy.

The judge's order does not mean President Donald Trump administration have to stop prosecuting people who cross the border illegally.

Federal officers have been ordered to stop detaining parents apart from their minor children. There are exceptions, including when the parent is found unfit, or the parent declines reunification. The order also states that all children under the age of 5 will be reunified with their parents in 14 days, and all minors older than 5 will be reunited with their parents within 30 days. Officials also must provide phone contact with parents children within 10 days and for any remaining interim.

"Plaintiffs have demonstrated a likelihood of success on the merits, irreparable harm, and that the balance of equities and the public interest weigh in their favor, thus warranting issuance of a preliminary injunction," US District Court Judge Dana Sabraw wrote Tuesday when the order was issued.

"This is a complete victory for these families and children who have been suffering for months," said Lee Gelernt, an attorney with the ACLU. "Many of these parents and children thought they might never see each other again. They have literally been living through a nightmare and the court has now ended their trauma."

Undocumented immigration across the US-Mexico border Show all 14 1 /14 Undocumented immigration across the US-Mexico border Undocumented immigration across the US-Mexico border Immigrant children, many of whom are separated form their parents, are housed in Texas' tent city Reuters Undocumented immigration across the US-Mexico border A two-year-old Honduran asylum seeker cries as her mother is searched and detained near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Undocumented migrants ride on the top of a freight train referred to as the beast, or La Bestia Getty Undocumented immigration across the US-Mexico border A cage inside a US Customs and Border Protection detention facility in Texas Reuters Undocumented immigration across the US-Mexico border US Border Patrol Academy All new agents must complete a months-long training course at the New Mexico facility before assuming their posts at Border Patrol stations, mostly along the US-Mexico border Getty Undocumented immigration across the US-Mexico border US-Mexico border fence A group of young men walk along the Mexican side of the US-Mexico border fence in a remote area of the Sonoran Desert Getty Undocumented immigration across the US-Mexico border US-Mexico border fence in the US Man looks through US-Mexico border fence into the US in Tijuana, Mexico Getty Undocumented immigration across the US-Mexico border US-Mexico border fence US Border Patrol agent Sal De Leon stands near a section of the US-Mexico border fence while stopping on patrol on in La Joya, Texas Getty Undocumented immigration across the US-Mexico border US Border Patrol Academy US Border Patrol instructor yells at trainees after their initial arrival to the academy Getty Undocumented immigration across the US-Mexico border Memorial service in Guatemala Families attend a memorial service for two boys who were kidnapped and killed in San Juan Sacatepequez, Guatemala. Crime drives emigration from Guatemala to the United States, as families seek refuge from the danger Getty Undocumented immigration across the US-Mexico border Arrests on the border Undocumented immigrants comfort each other after being caught by Border Patrol agents near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Detention holding facility A boy from Honduras watches a movie at a detention facility run by the US Border Patrol Getty Undocumented immigration across the US-Mexico border Mexican farm workers Mexican migrant workers harvest organic parsley at Grant Family Farms in Wellington, Colorado Getty Undocumented immigration across the US-Mexico border Mexican family in Arizona A Mexican immigrant family sits in the living room of their rented home in Tuscon, Arizona. The family that Arizona's new tough immigrant law had created a climate of fear in the immigrant community. Getty

"This Order does not implicate the Government's discretionary authority to enforce immigration or other criminal laws, including its decisions to release or detain class members," Judge Sabraw explained. "Rather, the Order addresses only the circumstances under which the Government may separate class members from their children, as well as the reunification of class members who are returned to immigration custody upon completion of any criminal proceedings."