President Obama surely knew that his recent executive actions to protect millions of undocumented immigrants from deportation would run into trouble as soon as a 26-state lawsuit opposing the actions landed on the desk of Federal District Judge Andrew Hanen, of Brownsville, Tex.

Judge Hanen — who last month invoked a biblical flood in describing illegal immigration into that community — has spoken out aggressively against Mr. Obama’s immigration policy in the past, saying it “endangers America” and is “an open invitation to the most dangerous criminals in society.” Indeed, his earlier opinions were the reason Republican governors and attorneys general pushed to get their suit into his district.

As expected, the judge on Monday night temporarily blocked the first of several programs Mr. Obama announced in November to offer work permits and a three-year reprieve from deportation to more than four million immigrants who are parents of American citizens and who have no criminal record.

That move — which Mr. Obama took only after years of failed efforts by Congress to pass any immigration reform — triggered the fury of congressional Republicans, who responded with threats of, among other things, impeachment proceedings.