A federal judge appointed by President Obama has blocked detainment of Central American women and children on the U.S.-Mexico border who allege they are seeking asylum. The judge enjoined the government “from detaining class members for the purpose of deterring future immigration to the United States and from considering deterrence of such immigration as a factor in such custody determinations.”

The judge issued his preliminary injunction order on Friday, ruling that “[t]he policy causes irreparable harm to mothers and children seeking asylum.” The judge, James E. Boasberg, serves on the United States District Court for the District of Columbia.

A lawsuit was filed in December 2014 by ten mothers from Central America. They crossed the border in the fall of 2014. The women did not have documentation and were detained by agents with U.S. Customs and Border Protection.

The plaintiffs, represented by the American Civil Liberties Union (ACLU) and the Immigration Clinic at the University of Texas School of Law, sued U.S. Secretary of Homeland Security, Jeh Johnson, and officials in the U.S. Immigration and Customs Enforcement Department. The detainees were allegedly kept for several weeks or months at facilities in Karnes City and Dilley, Texas, and Berks County, Pennsylvania.

The judge issued a 40-page opinion which included a finding that this detainment was inappropriate and was done “to send a message that such immigrants, coming en masse, are unwelcome.”

The jurist rejected the government’s claims that the detainment was necessary to national security. He also opined that government officials have “presented little empirical evidence, moreover, that their detention policy even achieves its only desired effect – i.e., that it actually deters potential immigrants from Central America.”

Judy Rabinovitz, Deputy Director of the ACLU Immigrants’ Rights Project, issued a statement saying “The court held that it was illegal to detain families based on deterrence. It made clear that the government cannot deprive individuals of their liberty merely to send a message to others.” She continued, “[t]his ruling means that the government cannot continue to lock up families without an individualized determination that they pose a danger or flight risk that requires their detention.”

Breitbart News reported last June that Department of Homeland Security Secretary Johnson issued an op-ed warning in Spanish-language news outlets to the parents of children illegally crossing the border. He wrote: “To the parents of these children I have one simple message: Sending your child to travel illegally into the United States is not the solution.” He continued:

“Rather, under current U.S. laws and policies, anyone who is apprehended crossing our border illegally is a priority for deportation, regardless of age. That means that if your child is caught crossing the border illegally, he or she will be charged with violating United States immigration laws, and placed in deportation proceedings – a situation no one wants,” he wrote. “The document issued to your child is not a ‘permiso,’ but a Notice To Appear in a deportation proceeding before an immigration judge.”

The Judge who issued the injunction on Friday received media attention in April of 2012 for his controversial ruling blocking public viewing access of a deceased Osama Bin Laden. Judge Boasberg also serves on the Foreign Intelligence Surveillance Court. He was appointed to that position by Chief Justice John G. Roberts in 2014.

A status conference on the case is scheduled for March 6, 2015 at 10:00 a.m.

Lana Shadwick is a contributing writer and legal analyst for Breitbart Texas. Follow her on Twitter @LanaShadwick2.