There’s a disturbing cycle to Donald Trump’s war on immigrants. It starts with the president’s demand for harsher policies on the southern border, no matter how legally or morally dubious they may be. His subordinates have two options: to do what he says, or try to change his mind. If the former, the courts usually intervene to stop the policy, and Trump only gets more enraged, more extreme. If the latter—well, Trump only gets more enraged, more extreme.

Over the weekend, Trump ousted Homeland Security Secretary Kirstjen Nielsen, who was hardly a disloyal cabinet member. She agreed to put traumatized migrant children in cages last year and defended Trump’s “zero tolerance” border policy to no end. But in recent weeks, she reportedly resisted Trump’s orders for more dramatic crackdowns. He then purged most of the department’s upper ranks on Monday in a bid to replace the current slate of hardliners with more pliable figures.

When Trump does find someone to carry out his policies, though, it only extends his unprecedented losing streak in the courts. Last month, The Washington Post tabulated 63 different cases where federal judges ruled against the administration. Trump sometimes wins on appeal, as he did with the Muslim travel ban last summer, but judges have halted many of his border-related efforts. On Monday night, a federal judge in California blocked a policy implemented by Nielsen last December to send asylum seekers to Mexico while their legal proceedings in the U.S. unfolded.

Those defeats, in turn, only spur Trump to take more aggressive steps in the future. According to The New York Times, Trump wants to restart family separation, impose even more barriers to asylum claims, build the wall more quickly, and revoke birthright citizenship by executive order. And the cycle repeats itself.

Something’s got to give. The president isn’t likely to abandon his Ahab-like obsession with border security, and the courts aren’t likely to start ignoring his contortions of federal immigration law. As the 2020 election draws closer, and Trump’s need to inflame his supporters grows more urgent, the risk only grows that he’ll start ignoring the rule of law altogether to achieve his unattainable goals.