When President Trump made his “shithole” countries comment earlier this year, he revealed the ugly undercurrent of racism that has animated U.S. immigration law and policy since the Republic’s founding.

Whether such sentiments are made explicit or not, notions of which immigrants are “worthy” or “legal” bleed into the lives of immigrants and impose enormous restrictions on the rights and privileges of non-citizens, particularly undocumented persons. Some of these barriers facing non-citizens are already well-known, such as the denial of welfare benefits, precarious access to higher education, and most recently the sanctioning of indefinite detention. But a lesser known barrier undocumented persons face is the subtle paring down of their right to raise their own children.

Despite a long history of Supreme Court precedent upholding the fundamental right of parents to custody and care of their children, child welfare agencies and family courts across the country have been separating children from their undocumented parents on the basis of immigration status.

The rights of parents to care for their children have long been recognized, dating back to early 20th century decisions affirming the liberty interests of parents in making education decisions. More recently, in Troxel v. Granville, the Supreme Court reaffirmed parents’ Fourteenth Amendment substantive due process right to custody over their children. Accordingly, there is a presumption that when a parents make decisions for their children, they have their best interests in mind. Only when a parent is found to be unfit does a court ask whether it is in the best interest of the child to be removed.

Importantly, since the Fourteenth Amendment extends protection to all persons, this right is held by citizens and non-citizens alike.

However, these important parental interests have been undermined by racial stereotypes wielded by state authorities to intervene and disrupt families of color for generations. Child welfare agencies and government lawyers have used the tropes of the absent Black father and the deviant Black mother to translate the fact of poverty into accusations of neglect, resulting in a vastly disproportionate number of children of color in the foster care system. (For a classic treatment of racial injustice in the child welfare system, read Shattered Bonds: The Color of Child Welfare by Dorothy Roberts).

Likewise, a similar dynamic occurs when notions of undocumented immigrants’ “illegality” interact with the discretion exercised by judges in the family law context. According to David Thronson, deeply ingrained narratives of undocumented persons’ illegality, and their consequent unworthiness of rights protections, have been accepted by many family courts. In some cases, family court judges have gone so far as to refuse custody to undocumented parents on the basis of their immigration status alone. In Georgia, an undocumented father’s child was removed from his custody and his parental rights terminated because, although he was not facing removal by immigration authorities at the time, there was a possibility that he might be deported one day.

More often, though, courts will couch discrimination on the basis of immigration status in terms of parental fitness.  In re Interest of Angelica L. is illustrative of this logic: the family court found an undocumented mother from Guatemala to be unfit and terminated her parental rights over her newborn daughter because “the status of an undocumented immigrant is, no doubt, fraught with peril.” Although the Nebraska Supreme Court later reversed that decision, such reasoning is widespread among family courts and is often affirmed at the appellate level.

In Missouri, the state Court of Appeals upheld a decision by the juvenile court terminating a mother’s parental rights by characterizing her status in the country as “criminal activity” and finding that, as a law breaker, she was unfit to parent. Commenting on the case, Anita Ortiz Maddali observed that when the narrative of illegality seeps into family law assessments, it obscures the fact that “these are parents who desperately want to care for and provide for their children, which can be their primary motivation for migrating.”

Moreover, family courts are increasingly ignoring questions of parental fitness when terminating undocumented parents’ rights, instead focusing on their own determination of the child’s best interest. For example, in Anita C. v. Superior Court, the California Court of Appeal’s decision to uphold the removal of a child from his mother’s custody focused solely on discussions of the child’s interests; tellingly, the word fitness does not appear in the opinion.

The result of this troubling dynamic is that, according to a 2011 study, 5100 children of detained or deported parents are currently in the foster care system. Moreover, over half a million U.S. citizen children have had at least one parent deported. The impact of parental separation and deportation is obviously devastating for children, leading to long-term developmental and behavioral issues.

The perverse irony is that the goal of both the family welfare and immigration systems purports to be family reunification. But the corrosive effect of anti-immigrant sentiment has distorted these purposes, splitting families apart and placing insurmountable obstacles in the path of parents who have made incredible sacrifices for their children.