A federal judge has stepped in to halt immigration officers from detaining women and children fleeing violence in Central America to seek asylum in the United States, saying that the policy is “likely unlawful.”

Currently, immigrants who cross over the border between the U.S. and Mexico are detained while their asylum claims are processed. But U.S.District Judge James E. Boasberg wrote in a 40-page decision on Friday that the Department of Homeland Security is “detaining Central American mothers and children with the aim of deterring potential future immigrants.”

The strategy was part of Obama’s “aggressive deterrence strategy” from this summer, which is meant to make the idea of crossing the border less appealing because of the huge number of people doing so, according to the Washington Post.

Between October and July, more than 57,000 children were picked up near the area, the Los Angeles Times reported.

“We are very concerned to see the continued expansion of family detention, which we know does not work,” Katharina Obser, of the Women’s Refugee Commission, one of many human rights organizations speaking out against the policy, told MSNBC last year, on the news that more than 66,000 “family units” crossed the border over the summer. Many came from Honduras, El Salvador, Guatemala and Honduras and felt their safety was in jeopardy at home.

The case Boasberg wrote on was brought by 10 people who had been detained at the border and were found to have “credible fear” of persecution in their home country. None of them had a criminal history and all had relatives already in the United States with whom they could have stayed.

“Although, in the past, individuals in this position were generally released while their asylum claims were processed, Plaintiffs were not so lucky,” he wrote.

According to the filing, mothers and their minor children were held for weeks or months, in an effort to “send a message that such immigrants, coming en masse, are unwelcome.”

They argued that the detention violates the Fifth Amendment, the Immigration and Nationality Act, the Administrative Procedure Act and Department of Homeland Security regulations and that the practice should be stopped until courts could decide on its merits.

The judge granted their motion to put the practice on hold, temporarily, until a hearing scheduled for March 6.