By Wednesday morning, the president had become convinced that he needed a way to calm the criticism, according to people familiar with the discussions, and he felt confident that Republicans in Congress would push through immigration legislation ending the family separation practice — so he might as well get ahead of it. A vote on the measure was eventually postponed until next week, but it does not appear to have enough votes to pass.

In private conversations with aides, Trump said he wanted to sign a full immigration bill as part of an executive order, which one administration official described as “a pretty insane idea.” The president was told by government lawyers that he could not change immigration law by fiat, said a person familiar with the discussions.