WASHINGTON — President Trump and Democratic congressional leaders dug in Wednesday for a lengthy partial shutdown in a newly divided government after a White House meeting — the first in 22 days — could not break an impasse over Mr. Trump’s demands for billions of dollars for a border wall.

During the contentious meeting in the Situation Room, Mr. Trump made his case for a wall on the southwestern border and rejected Democrats’ proposals for reopening the government while the two sides ironed out their differences.

“I would look foolish if I did that,” Mr. Trump responded after Senator Chuck Schumer of New York, the Democratic leader, posed the question to him directly, according to three officials familiar with the meeting who described it on the condition of anonymity. He said that the wall was why he was elected, one of the officials said.

Democrats were equally adamant, according to another official who was present for the discussion. Pressed by Vice President Mike Pence and Representative Kevin McCarthy of California, the incoming minority leader, they refused to budge from their offer to devote $1.3 billion to border security. The official also insisted on anonymity to describe the private conversation.