WASHINGTON -- The Senate voted Thursday afternoon to overturn President Donald Trump’s emergency declaration aimed at securing billions of dollars for a wall along the U.S.-Mexico border without congressional approval, a rare rebuke from the GOP-controlled chamber.

Even as the president threatened a veto and urged Republicans to stay in line, 12 GOP senators voted against him amid a debate over the limits of presidential power. The bipartisan 59-41 vote handed Trump his second defeat in as many days and will further delay his ability to deliver the long-promised wall.

Opponents have not secured enough votes to override a Trump veto, likely leaving the courts to resolve whether Trump has the authority to reroute already appropriated federal funds to the wall. The Constitution gives Congress the power to set spending, but in 1976 lawmakers gave presidents the power to declare emergencies.

Sen. Pat Toomey (R., Pa.) voted against Trump, joining with Republican colleagues. The GOP caucus has mostly enabled the White House’s agenda.

“I am completely supportive of the ultimate underlying policy goal,” Toomey said in an interview with The Inquirer and Allentown Morning Call, calling the president’s push for $5.7 billion of wall funding “completely reasonable.”

But he cast the debate as a question of the proper separation of powers, arguing that a president should not be able to sidestep Congress’ authority over spending with an emergency declaration.

“I support what the president is trying to do, I don’t support the way the president is going about it, and to me that’s an important distinction,” Toomey said.

Trump followed through in a tweet saying, “VETO!”

Democrats cast the issue as something bigger than a debate over one policy, and they were joined by a sizable band of Republicans. Other Republicans voting against Trump’s border emergency were Lamar Alexander of Tennessee, Roy Blunt of Missouri, Susan Collins of Maine, Mike Lee of Utah, Jerry Moran of Kansas, Lisa Murkowski of Alaska, Rand Paul of Kentucky, Rob Portman of Ohio, Mitt Romney of Utah, Marco Rubio of Florida, and Roger Wicker of Mississippi.

“President Trump has shown zero understanding of what his emergency portends for the separation of powers in our democracy,” Senate Minority Leader Chuck Schumer (D., N.Y.) said on the Senate floor. “It’s our job here in Congress to limit executive overreach, to defend our core powers, to prevent a president – any president – from ignoring the will of Congress every time it fails to align with the will of the president.”

The Senate vote marked the second time this week that some Republicans joined Democrats in a rebuke of Trump policy.

On Wednesday seven GOP senators voted with Democrats to end military assistance for Saudi Arabia’s war in Yemen. The vote was widely seen as an expression of frustration with how Trump has handled the Saudi regime, and in particular the murder of journalist Jamal Khashoggi, a columnist for the Washington Post.

The border-wall vote carried even more political weight after a lengthy government shutdown ended without the added wall funding he wanted.

House Democrats, flexing their newfound control, forced the Senate to schedule a vote on the controversial issue under congressional rules, and the threshold for passage in the upper chamber is a simple majority, rather than the 60 votes needed for most legislation, stripping Trump of some of his normal political protection.

Trump and most Republicans argued that the wall is critical to fighting undocumented immigration that has created a crisis threatening public safety.

“The facts are not at all ambiguous: There’s a clear border security and humanitarian crisis on the southern border of the United States of America,” Senate Majority Leader Mitch McConnell (R., Ky.) said on the Senate floor.

He cited Customs and Border Patrol estimates that border apprehensions for the current fiscal year are nearly double those for fiscal year 2017.

Conservatives, including Toomey, have long prioritized limiting government, and worried that future presidents could use such a broad view of emergency powers to advance more liberal policies on, say, gun laws, or climate change.

Toomey characterized arguments for the legality of the declaration as “strained” and said his stand was consistent with his opposition to executive actions by President Barack Obama when he felt the Democratic president exceeded his authority.

Toomey had said for weeks that he was uncomfortable with the emergency declaration, though he did not say how he would vote until Thursday morning. By that time, it had become clear that the disapproval resolution would pass.

Toomey said he did not want to announce his vote while he and other GOP senators were discussing other possible avenues out of the confrontation, including proposals to curtail the presidents’ emergency powers. Several Republicans hoped such ideas would allow them to stand against an expansion of executive power without directly confronting Trump. But none gained enough support, and the Senate was left Thursday with a vote framed as with Trump, or against him.

Toomey acknowledged that Trump’s veto threat means the vote will not stop the emergency declaration. He hoped that the broad bipartisan support for the resolution will lead to a push to restrain emergency powers going forward.