The president has largely blocked asylum seekers and refugees fleeing persecution, war and violence. He has built nearly 300 miles of border wall (though without persuading Mexico to pay for it, as he once insisted). He has made it harder for poor people to immigrate to the United States, imposed travel bans on predominantly Muslim countries, and separated migrant children from their parents at the border.

At times, he has used racist messaging, condemning “shithole countries” and complaining that people from Haiti “have AIDS.”

That messaging was at the heart of Mr. Trump’s 2016 campaign, when he complained that Mexico was sending “rapists” and criminals to the United States. At the time, he vowed to build a border wall and used grim and threatening language about immigrants to instill fear in his supporters.

As president, he made good on many of those promises, and again used a fear of immigrants to energize his core supporters during the 2018 midterm elections. He warned, falsely, that migrant caravans from Central America were filled with murderers and criminals when in fact most were families with women and children fleeing persecution, war, famine and violence.