Where to begin? In the same week that he announced his nominee for the Supreme Court, the president of the United States pre-emptively accused not only a judge, but the whole judicial branch — the most dependable check on his power — of abetting the murder of Americans by terrorists. It’s reasonable to wonder whether Mr. Trump is anticipating a way to blame meddling courts for any future attack.

There was, in fact, a terrorist attack shortly after Mr. Trump issued his immigration order: a white supremacist, officials say, armed himself with an assault rifle and stormed a mosque in Quebec City, slaughtering six Muslims during their prayers. Mr. Trump has not said a word about that massacre — although he was quick to tell America on Twitter to “get smart” when, a few days later, an Egyptian man wielding a knife attacked a military patrol in Paris, injuring one soldier.

In the dark world that Mr. Trump and his top adviser, Stephen Bannon, inhabit, getting “smart” means shutting down immigration from countries that have not been responsible for a single fatal attack in the United States in more than two decades. As multiple national security experts have said, the order would, if anything, increase the terrorism threat to Americans. And contrary to Mr. Trump’s claim, no one is “pouring in” to America. Refugees and other immigrants already undergo a thorough, multilayered vetting process that can take up to two years.

But Mr. Trump’s threats are based on fear, not rationality, which is the realm of the courts.

Judge Robart is not the first judge Mr. Trump has smeared. During the presidential campaign last year, he pursued bigoted attacks on a federal judge presiding over a class-action fraud lawsuit against his so-called Trump University. The judge, Gonzalo Curiel, could not be impartial, Mr. Trump claimed, because he “happens to be, we believe, Mexican,” and Mr. Trump had promised to build a border wall and deport millions of undocumented Mexican immigrants. (Judge Curiel was born in Indiana, and Mr. Trump settled the lawsuit in November for $25 million.)

Coming from a candidate, this was merely outrageous; coming from the president, it is a threat to the rule of law. Judges can now assume that if they disagree with him, they will face his wrath — and perhaps that of his millions of Twitter followers.