“We have an issue that has been litigated and adjudicated through Congress. I mean, what was more litigated than this very question? We had a government shutdown for crying out loud,” said Senator Patrick J. Toomey, Republican of Pennsylvania, referring to funding for the border wall, which Mr. Trump is trying to secure with an emergency declaration that would circumvent Congress.

“It’s about separation of powers,” Mr. Toomey said. “It’s about respecting the principles of the Constitution.”…

But the rare coalition of Democrats and Republicans could bolster legal challenges to the emergency declaration that could tie up wall funding indefinitely. And the mere act of defying Mr. Trump foreshadows potential new difficulty for the president as he seeks to push his agenda through a Democrat-controlled House and a less pliant Republican-controlled Senate.

“There are moments where you see a partisan rebuke” of the president by Congress, said William G. Howell, a political scientist at the University of Chicago and the author of “Power Without Persuasion: The Politics of Direct Presidential Action.” “They are really pretty infrequent, and when you do observe them it speaks to real tumult in the party.”