In a remarkable rebuke to President Donald Trump on his signature issue, 12 Republican senators joined Democrats on Thursday in voting to block the president from declaring a national emergency to build his wall on the southern border.

The final tally was 59-41 in favor of stopping the president’s emergency declaration.

Heading into the vote, it was clear that enough Republicans would approve the resolution of disapproval to give it the 50 votes needed to advance it out of the GOP-controlled Senate, forcing the president to veto it. The real question was how many Republican senators would defy a president who many of them have been fearful to cross.

The answer was quite a few.

Senate Republicans felt emboldened to push back against Trump’s effort to build the wall by using the emergency maneuver, in part because the declaration was seen as a brazen attempt to undermine their constitutional powers.

Others worried about its potential effects on military construction and disaster relief funds, which the emergency declaration would permit Trump to raid. Others felt it would set a precedent that future Democratic presidents would use to push their own domestic priorities.

After weeks of senators hemming and hawing, a GOP jailbreak unfolded, with several senators declaring their support for the resolution on the day of the vote.

The list of defectors included long-serving senators such as Lamar Alexander of Tennessee, regular Trump critics such as Lisa Murkowski of Alaska, and even such Trump allies as Sen. Rand Paul of Kentucky. Sen. Roger Wicker of Mississippi, one of the most reliable votes for GOP leadership, also voted for the disapproval resolution.

The dam seemed to break mid-morning when Sen. Mitt Romney (R-UT) declared he would vote for the resolution of disapproval on grounds that it broke with the spirit of the Constitution and the balance of powers.

In a floor speech, Sen. Rob Portman (R-OH) cited the alarming precedent Trump’s move would set when explaining his decision to buck the president. While securing the border was important, Portman said, it should be done in a way that doesn’t violate constitutional norms.

“It doesn’t mean the president can ignore Congress and substitute his will for the will of the people,” he said.

The White House seemed to know early on that they would have trouble holding Republicans together, with the president taking to Twitter to press for loyalty and warn about the prospects of not getting a border wall built.

“A vote for today’s resolution by Republican Senators is a vote for Nancy Pelosi, Crime, and the Open Border Democrats!” he tweeted on Thursday morning.

Hoping to find a middle ground, some GOP senators attempted to push a bill to automatically end national emergencies after 30 days—seen as an off-ramp for those concerned about precedent and constitutionality but eager to pacify Trump. But both Trump and Speaker Nancy Pelosi (D-CA) rejected the idea.

The vote signifies one of the most significant rebukes of this president that Senate Republicans have issued to date. But its impact will likely be short-lived. Trump will veto the resolution. At that point two-thirds of the members of both houses of Congress will be required to override a veto. And there is no indication that the numbers are there to defy the president by those margins.

From there, the most viable challenge to the emergency declaration is through federal court.

While the Republican Senate’s vote on Thursday weakens Trump’s hand politically and exposes cracks in his iron grip on the party, there were still indications that his power within the party is strong. Sen. Thom Tillis (R-NC), who wrote an op-ed in support of the resolution of disapproval less than three weeks ago, said in a floor speech that after intensive meetings at the White House and with other senators he decided to vote against the resolution.

“I’ve received a lot of feedback over the last few weeks,” he said.

Tillis is considered one of the more vulnerable Republicans up for re-election in 2020.