Rebel members of President Donald Trump's party have helped pass a vote to reject his declaration of an emergency on the US-Mexico border.
Twelve Republican Senators broke party lines to side with Democrats, passing a proposal to revoke the declaration by 59-41.
The Democratic-controlled House of Representatives last month backed the measure.
Mr Trump earlier acknowledged he would "probably" have to veto the resolution.
Congress needs a two-thirds majority of both chambers to override a presidential veto, which is viewed as unlikely in this case.
Nevertheless, the defeat will be seen as an embarrassing loss for the president on his signature domestic policy issue.
It comes just a day after the Senate rebuked him on foreign policy by approving a bill to end US support for the Saudi-led coalition in Yemen.
The Republican rebels were Mitt Romney and Mike Lee of Utah, Marco Rubio of Florida, Roy Blunt of Missouri, Lamar Alexander of Tennessee, Pat Toomey of Pennsylvania, Rob Portman of Ohio, Jerry Moran of Kansas, Susan Collins of Maine, Lisa Murkowski of Alaska, Rand Paul of Kentucky, and Roger Wicker of Mississippi.
Thom Tillis of North Carolina changed his mind minutes before the vote and said he would oppose it.
Mr Trump declared the emergency in an attempt to circumvent Congress and fund his long-promised border wall.
Earlier, he called Democrats "border deniers" and said any Republican opposing him would be casting "a vote for Nancy Pelosi".
The Democrats are “Border Deniers.” They refuse to see or acknowledge the Death, Crime, Drugs and Human Trafficking at our Southern Border!— Donald J. Trump (@realDonaldTrump) March 14, 2019
A vote for today’s resolution by Republican Senators is a vote for Nancy Pelosi, Crime, and the Open Border Democrats!— Donald J. Trump (@realDonaldTrump) March 14, 2019
The Republican president declared the emergency on 15 February after Congress refused funding for a wall on the US-Mexico border, a key campaign pledge.
He says the barrier is needed to combat illegal immigration on the southern border which he has described as a "crisis".
He hopes the declaration will allow him to fund the wall by circumventing Congress and raiding military budgets.
It would open up almost $US8bn for the wall, which is still considerably short of the estimated $US23bn cost of a barrier along almost 3200km of border, but far more than the nearly $US1.4bn begrudgingly allotted last month by Congress.
Democrats say the declaration is unconstitutional and that Mr Trump has manufactured the border emergency.
The resolution to revoke the declaration passed the House by a margin of 245-182. Thirteen Republicans sided with Democrats.
"This isn't about the border. This is about the constitution of the United States. This is not about politics. It's not about partisanship. It's about patriotism," House Speaker Nancy Pelosi said at the time.
Lawmakers are using a provision from the National Emergencies Act to overrule the president, but it requires both chambers of Congress to vote for it.
However, some Republicans have supported Mr Trump's decision and accused Democrats of ignoring the emergency at the border.
Senate Majority Leader Mitch McConnell says the declaration is "the predictable and understandable consequences of Democrats' decision to put partisan obstruction ahead of the national interest".