“The president is doing an end run around Congress,” Ms. Pelosi told reporters. She suggested that Mr. Trump was setting a precedent for future Democratic presidents to act on issues like gun control — precisely the scenario that scares Republicans.

“You want to talk about a national emergency, let’s talk about today,” Ms. Pelosi said, reminding Mr. Trump that it was the anniversary of the shooting massacre last February at Marjory Stoneman Douglas High School in Parkland, Fla. Seventeen students and staff members were killed. “That’s a national emergency. Why don’t you declare that emergency, Mr. President? I wish you would.”

Senator Chuck Schumer of New York, the Democratic leader, echoed her criticism and said Congress would defend its prerogatives. “The public was more opposed to the emergency declaration than they were to the wall,” he said in a brief interview. “And they were opposed to the wall.”

About a half-dozen Senate Republicans quickly spoke out against the move, as well. “I don’t think this is a matter that should be declared a national emergency,” said Senator Lisa Murkowski of Alaska. “We as legislators are trying to address the president’s priority. What we’re voting on now is perhaps an imperfect solution, but it’s one we could get consensus on.”

Senator Susan Collins of Maine said such a declaration was “of dubious constitutionality,” while Senator Marco Rubio of Florida called it “a bad idea.” Senator Rand Paul of Kentucky said, “We have a government that has a Constitution that has a division of power, and revenue raising and spending power was given to Congress.”

Still, other Republicans backed Mr. Trump, including an ally, Senator Lindsey Graham of South Carolina, as well as Senator Shelley Moore Capito of West Virginia, who faces re-election next year. “He feels that declaring a national emergency gives him that flexibility that he wants and needs, so I’m supportive of that,” Ms. Capito said of the president.

“For goodness’ sake, we tried for 35 days in December and January, right, to get the Democrats to do what everyone knows needs to happen except Democrats,” said Representative Jim Jordan, Republican of Ohio. “I support the national emergency declaration 100 percent.”