WASHINGTON (Reuters) - The U.S. Senate on Thursday rebuked President Donald Trump by voting to end his border emergency declaration, as 12 Republicans joined Democrats to deliver a second blow in as many days to the president, who quickly pledged a veto.

The 59-41 vote was a bipartisan repudiation of Trump’s decision to circumvent Congress and take money already designated for other programs and redirect it to pay for his U.S.-Mexico border wall, which he promised to build during his 2016 campaign.

In the first two years of his term, the Republican-led Congress mostly accommodated Trump, which spared him from having to use his veto pen. With Republicans showing increased willingness to defy him, Trump promised a change.

“VETO!” he tweeted shortly after the vote.

The vote on Thursday marked back-to-back defeats for Trump in the Republican-controlled Senate. On Wednesday, senators approved a resolution seeking to end U.S. support for a Saudi Arabia-led coalition in the war in Yemen, rejecting Trump’s policy toward the kingdom.

“Today’s votes cap a week of something the American people haven’t seen enough of in the last two years,” Senate Democratic leader Chuck Schumer told reporters. “My hope is that this past week isn’t an aberration, but a turning point.”

A House of Representatives leadership aide said there would likely be a vote to attempt to override Trump’s promised veto on March 26 after lawmakers return from a one-week recess.

The measure is unlikely to become law as there are enough Republicans in the House and Senate to sustain a Trump veto, which requires a two-thirds majority in both chambers to override. The issue could ultimately be decided by the courts.

Trump has made clamping down on illegal immigration a cornerstone of his presidency and it promises to be central to his 2020 re-election campaign.

His drive for billions of dollars to build a U.S.-Mexico border wall - one that he initially promised Mexico would pay for - has placed a wedge between him and Congress, including many Republicans who are uncomfortable even talking about a “wall.” Many in Congress say effective border security requires a range of law enforcement tools.

Senate Majority Leader Mitch McConnell had urged his fellow Republicans to defeat the resolution rejecting the emergency declaration, which was passed in February by the Democratic-controlled U.S. House of Representatives.

Construction workers in the U.S. work on a new section of the border fence as seen from Tijuana, Mexico February 18, 2019. REUTERS/Jorge Duenes

Republicans who defected by supporting the measure to end the emergency declaration are worried that presidents - including future Democratic ones - could usurp the power of Congress to fund the government and use the tactic to pass their own pet programs.

McConnell said Trump was “operating within existing law” and that if senators did not like the powers provided to the president under the National Emergencies Act, “then they should amend it.”

COURTS LIKELY TO DECIDE

At stake are billions of dollars in funding for barriers along the U.S.-Mexico border that Trump is demanding but Congress has refused to fully provide. The stalemate led to a 35-day partial government shutdown that ended in January.

Under the emergency declaration he signed on Feb. 15, Trump would take money from other federal programs to build the barrier, which he says is needed to curb illegal immigration and drug trafficking.

Even with a veto threat looming, senators and legal experts said Congress was sending a message that could be cited by judges in several lawsuits challenging Trump’s emergency declaration.

“It’s an important legal statement,” said Senator Angus King, one of two Senate independents. “It tells the court this is explicitly not approved by Congress. By voting this resolution, Congress is reiterating we don’t approve of this expenditure.”

Peter Shane, a law professor at the Moritz College of Law at Ohio State University, agreed.

“Congress’s vote, even if vetoed, would solidify any court’s understanding that the so-called emergency is really part of an end-run around a legislative branch that is unconvinced an emergency exists, that refused to fund the wall, and that is constitutionally in charge of federal spending,” he said.

Democrats deny there is an emergency at the border, saying border crossings are at a four-decade low.

“Democrats and Republicans both know the sad truth: The president did not declare an emergency because there is one,” Schumer said on the Senate floor. “He declared an emergency because he lost in Congress and wants to get around it.”

King expressed frustration the Department of Defense had so far refused to provide Congress with the projects it would have to suspend under Trump’s emergency declaration in order to fund the wall.

“We have a reasonable expectation of knowing what the universe of potential projects cuts are before we take this vote,” King said in a telephone interview with Reuters shortly before the vote, adding Trump was attempting to “undo” $3.6 billion worth of defense projects already approved by Congress.