Trump's response was swift and unequivocal: "VETO!" he tweeted after a dozen Republicans joined Democrats in voting down the emergency, declared as a way to secure alternative funding for the border wall denied to him by Congress.
Opponents had argued that Trump's emergency amounted to executive overreach, saying a vote to curtail his authority would preserve the constitutionally mandated separation of powers in Washington.
Half a dozen Republicans had already spoken out publicly against the February declaration. But on the morning of the vote, the simmering revolt grew to 12 Republicans, and the final tally was a resounding 59 to 41.
Trump had made clear he planned to use his veto powers to override any congressional block, after failing to strong-arm enough Republicans into line.
"I look forward to VETOING the just passed Democrat inspired Resolution which would OPEN BORDERS while increasing Crime, Drugs, and Trafficking in our Country," he tweeted, following up on his initial one-word response.
"I thank all of the Strong Republicans who voted to support Border Security and our desperately needed WALL!"
Unless there is a substantial weakening of support for Trump among congressional Republicans on the issue, the first veto of his presidency is expected to stand.
The Senate and House of Representatives would each need a two-thirds majority to override a block by the White House, and both parties say the numbers are not likely there.
"It won't be overturned and the legal scholars say it's totally constitutional," Trump told reporters of his emergency.
'Don't vote with Pelosi!'
Trump argues the move allows him to skirt Congress and repurpose billions of dollars in other government funds, including money earmarked for military facilities.
But Democrats and some Republicans point to Congress's constitutional duty to control government purse strings -- and say declaring an emergency to seize more money is an abuse of executive authority.
Senator Mitt Romney, the 2008 Republican presidential nominee, opposed Trump on the declaration, saying he cast his vote "for the constitution and for the balance of power that is at its core."
A group of Republicans had sought to limit defections by cutting a deal with the president to rein in emergency declaration powers, but Trump refused.
He set the stage for the showdown by using now-familiar pressure tactics, unsuccessfully warning Republicans not to rebuke him on the emergency.
"Don't vote with Pelosi!" he boomed on Twitter early Thursday, referring to House Speaker Nancy Pelosi whose Democratic-led chamber had already approved the resolution.
Pelosi, who lunched with Trump and the Irish Prime Minister Leo Varadkar at the US Capitol two hours before the critical Senate vote, had urged the upper chamber to "reject the president's unconstitutional measure."
Senate Majority Leader Mitch McConnell expressed support for Trump as he sought to rally his troops.
"The president is operating within existing law, and the crisis on our border is all too real," McConnell said, citing rising numbers of border detentions.
'Judgment of history'
But the chamber's top Democrat couched it as a power grab by an unrestrained president acting out of "pique."
"It's our job, here in Congress, to limit executive overreach, to defend our core powers" of controlling how federal dollars are spent, Senator Chuck Schumer said.
"This is not an everyday moment," he added. "The judgment of history weighs on this vote."
Numerous Senate Republicans, including some who sided with Trump Thursday, have called for a narrowing of parameters of the National Emergencies Act of 1976, under whose authority Trump and other presidents have acted in declaring their emergencies.
"I think that law is overly broad and I want to fix it," Senator Ben Sasse said. "But at present Nancy Pelosi doesn't, so I am therefore voting against her politically motivated resolution."
The White House laid out an ambitious 2020 budget proposal Monday which contains $8.6 billion in new wall funding, considerably above the $5.7 billion Trump sought for this year.
Lawmakers are unlikely to go along. Congress recently provided just $1.4 billion for construction of 55 miles (90 kilometers) of barriers along the border in Texas.
The White House has signaled it will seek to repurpose some $6 billion from military funds, without specifying which Pentagon programs would be slashed.
But re-apportioning military money is a prickly undertaking, and several lawmakers from both parties have warned against it.
Thursday's vote was the second bipartisan rebuke of Trump in as many days, after the Senate Wednesday voted to end US military support for the Saudi-led war effort in Yemen.
Trump has threatened to veto that measure too.