For the past seven months, the Department of Homeland Security has been detaining and refusing to release immigrant mothers and children – even newborns – who have fled extreme violence and persecution in Central America to seek refuge in the United States. Why would the government implement such a heartless policy? To send this message to other people who may consider coming in the future: "You're not welcome."

But now, by court order, this policy must end.

On February 20, in response to a class-action suit by the ACLU and others, a federal district court in D.C. ruled that it is illegal to detain asylum-seeking families to send a message to others and enjoined the government from doing so. The ACLU represents asylum-seeking families who have already been found by an immigration officer or judge to have a "credible fear" of persecution, meaning there is a "significant possibility" they will be granted asylum. Many have family members living in the United States who are willing to ensure that the families appear for scheduled court appearances.

The heartbreaking stories of our plaintiffs reflect the reasons these families braved a dangerous journey to the United States, and the reasons why they should not be subjected to detention. One is a mother who along with her son fled from Honduras after years of physical abuse at the hands of her son's father; another is a mother who fled from El Salvador with her 5-year-old and 8-month-old daughters to escape brutal and unrelenting abuse by the children's father; and another is a Salvadoran woman who escaped to the United States with her young son and daughter after her common-law husband physically abused her and threatened to kill her children.

Unfortunately, in family detention centers nationwide, these stories are not unique.

In the past, DHS generally did not detain families who arrived in the United States seeking asylum. Most eligible individuals were released if they could show that they were not a flight risk or a danger to the community. However, beginning in the summer of 2014, DHS started detaining families in large numbers as part of an "aggressive deterrence strategy" intended to send a message to other Central Americans that if they sought refuge in the United States, they would be similarly punished. Under this policy, even if families demonstrated that they had a credible fear of persecution and were neither flight risks nor dangerous, DHS refused to consider them for release and kept them locked up.

Sound cruel? It is . It's also unnecessary and illegal .

In its February 20 decision, the district court for the District of Columbia agreed. It ruled that the government cannot continue to lock up these families without determining that these individuals actually pose a danger or flight risk that requires their detention. It made a provisional decision that the case can proceed as a class action and granted a preliminary injunction against the government's policy. This means that DHS must now release families on bond or other conditions unless the family members pose a flight risk or danger.

Importantly, the court saw through the government's argument that detention of the women and children was necessary to prevent a mass influx that would threaten national security, explaining that the "incantation of the magic word ‘national security' without further substantiation is simply not enough to justify significant deprivations of liberty." It explained that "[t]he simple fact that increased immigration takes up government resources cannot necessarily make its deterrence a matter of national security. . . "

Since this decision, DHS has been setting bonds for families who it previously refused to release. And, although reports indicate that the bonds DHS is setting are often still prohibitively high, anecdotal reports suggest that immigration judges are lowering the bond amounts and families are being released.

The government's policy of refusing to consider these families for release was wrong and embarrassingly inhumane. The ACLU is urging the White House and DHS to acquiesce to the district court's decision rather than fight to reinstate its illegal family detention policy.

The case, RILR v. Johnson , was filed in U.S. District Court in Washington, D.C. Lead counsel are the ACLU's Immigrants' Rights Project and Covington & Burling LLP. Other counsel are the ACLU of the Nation's Capital, the ACLU of Pennsylvania, the ACLU of Texas, and the Immigration Clinic at the University of Texas School of Law at Austin.