President Obama’s speech Thursday night on immigration ended on a high, hopeful note. Mr. Obama, quoting Scripture’s admonition to welcome and protect the stranger, told millions who have lived and worked here for years, many of them Americans in all but name: We cannot fix your situation yet, but for now we will not expel you, because we have better hopes for you here.

A speech is not a solution, of course, and now that it is over, the hard work begins. Efforts over the last decade to repair immigration have repeatedly ended in failure, leaving the meanness of the broken status quo.

Now, though, there are reasons for encouragement, tempered with caution. Mr. Obama’s plan to register and give working papers to perhaps four million to five million people has rightly gained the most attention, but he and the Homeland Security Secretary, Jeh Johnson, have also declared a sweeping reordering of immigration enforcement. They are ending Secure Communities, a blighted program that used local police to funnel arrested immigrants to Immigration and Customs Enforcement.

In theory, this widened the dragnet for dangerous criminals. But in practice, it terrorized the innocent, alienated immigrant neighborhoods from their police protectors and encouraged — nationalized — Arizona-style campaigns of indiscriminate immigration crackdowns and racial profiling.