He made the migrant caravan from Central America a central campaign issue during the midterm election, and this fall, major television networks — including Fox News — rejected an inflammatory ad by Mr. Trump’s political team. The ad, which featured footage of an undocumented Mexican immigrant bragging about murder and included ominous music followed by images of the caravan, was widely denounced as racist and misleading.

The government shutdown, which was scheduled to begin at 12:01 a.m. Saturday, stems from a showdown over funding for a wall on the southern border, which Mr. Trump promised his supporters he would deliver once he was in the Oval Office.

Mr. Trump has demanded that about $5 billion for the wall be included in a spending bill necessary to keep the government running.

The Senate passed a stopgap spending bill this week that did not include money to build the wall. The House then merged the Senate’s stopgap spending bill with about $5.7 billion in funding for the wall and close to $8 billion in disaster relief funding, but that plan hit a roadblock in the Senate, where Democrats and a few key Republicans were opposed.

The House and the Senate adjourned Friday without resolving the impasse, sending the government barreling toward a partial shutdown. Both chambers were scheduled to reconvene Saturday at noon.