The judge, Emmet Sullivan, said it was unacceptable the government had deported the family and threatened to hold the United States attorney general, Jeff Sessions, in contempt if the situation was not resolved.
But Attorney General Jeff Sessions, along with Homeland Security Kirstjen Nielsen and other officials, could face consequences for the government's handling of the case if the judge believes they did not fully comply with his orders.
The woman, known in court papers as Carmen, is a plaintiff in a lawsuit filed this week by the American Civil Liberties Union. Carmen also alleged her husband was abusive.
"I'm not happy about this at all", Sullivan said.
The mother and daughter were part of a case filed by the ACLU and the Centre for Gender and Refugee Studies on behalf of 12 mothers and children who said they had fled violence but were at risk of deportation.
The lawsuit, known as Grace v. Sessions, argues that the policies cut against American and worldwide laws that recognize gender-based persecution as grounds for asylum and that they gut the protections the process is supposed to offer. The lawsuit says the police did not act when she contacted them.
It was a dramatic illustration of the Trump administration's zeal for deportations running up against an increasing number of court challenges against its immigration policies.
As Carmen is with a child, and, therefore, can not be held in a typical facility for adults or separated from her child under current policy, it is likely they will be released into the American interior, free, despite having failed their credible fear determination.
In June, Sessions reversed a long-standing policy that considered asylum cases on the basis of gang and domestic violence, and now allows fast-track rejections and deportations if those are the only factors involved. Carmen's asylum request was based on threats by gang members to kill her if she didn't pay them protection money routinely.
Washington DC District Court Judge Emmet Sullivan said that it was unacceptable that people claiming asylum had been removed while lawyers argued their case.
Immigrant-rights groups, though, say the tens of thousands of people lodging asylum claims are mostly deserving - and at the very least should get a more extensive hearing. Sullivan's eventual order had nothing to with the prior agreement between DOJ and the ACLU and imposed a blanket ban on deporting the two until the ACLU's lawsuit against Sessions runs its course.