A dozen Senate Republicans showed some independence on Thursday when they voted to cancel President Donald Trump’s declaration of an emergency on the U.S.-Mexico border, a major rebuke from members of his own party.

Trump has said he will veto the resolution, however, and not enough Republicans in the House or Senate have said they oppose the emergency to reach the two-thirds majorities needed to override the veto. Nevertheless, Thursday’s vote revealed simmering tensions between the president and members of his party on Capitol Hill who pleaded with him to change course.

Trump declared the emergency in February to secure funds to build a wall along the U.S.-Mexico border, but his administration hasn’t taken any action to begin construction. Trump resorted to using emergency powers after failing to convince Congress to allocate $5 billion to wall construction.

Border officials have said there is a humanitarian and security crisis due to a surge of families and children fleeing poverty and violence in central America. Trump, however, has claimed the people attempting to enter the U.S. along the southern border are mostly gang members and terrorists.

The White House and Senate Republicans had tried to head off Thursday’s disapproval vote by drafting legislation to curtail a president’s emergency powers. The idea fizzled, as House Speaker Nancy Pelosi (D-Calif.) said she wouldn’t bring it to a vote in the House and Trump himself rejected the idea in a conference call with GOP senators on Wednesday.

“We tried to cut a deal, the president didn’t appear interested,” Sen. Mike Lee (R-Utah) told a reporter on Wednesday. He announced later that he would vote for the resolution to terminate the declaration.

Trump tweeted ahead of the vote on Thursday that he would support efforts to amend the law pertaining to national emergencies at a later date, but the statement failed to quell opposition among his party.

The Republican senators who bucked Trump and supported the resolution were Lee, Mitt Romney of Utah, Lamar Alexander of Tennessee, Susan Collins of Maine, Lisa Murkowski of Alaska, Rand Paul of Kentucky, Pat Toomey of Pennsylvania, Jerry Moran of Kansas, Roger Wicker of Mississippi, Rob Portman of Ohio, Marco Rubio of Florida and Roy Blunt of Missouri.

“This is a vote for the Constitution and for the balance of powers that is at its core. For the Executive Branch to override a law passed by Congress would make it the ultimate power rather than a balancing power,” Romney said in a statement before the vote.

Toomey said upholding the separation of powers was “very important” and that the president made “a mistake” by seeking to build the wall with funds that were not appropriated by Congress.

Sen. Thom Tillis (R-N.C.), who last month wrote a grandiose op-ed about the constitutional separation of powers requiring a yes vote, announced Thursday that he had changed his mind.

“We have to recognize that we have a crisis at the border ― 76,000 people crossing illegally in February alone. We have narcotics flooding our country,” Tillis said on the floor, adding that he was encouraged by Trump’s openness to changing the law in the future.

Tillis is facing a tough re-election fight in 2020. Conservative activists urged Rep. Mark Walker (R-N.C.) to challenge Tillis in the primary election as they criticized the senator for his op-ed about the emergency declaration.

Sen. Cory Gardner (R-Colo.), another vulnerable incumbent up for re-election next year, also voted against the resolution. He said in a statement after the vote that he stood with Trump because “in the absence of Congressional action, the President did what Nancy Pelosi and Chuck Schumer refused to do.”

Sens. Ted Cruz (R-Texas) and Ben Sasse (R-Neb.), two self-described constitutional conservatives, also stood with Trump and opposed the resolution. Cruz, in particular, is known for his vocal criticism of executive overreach during the previous administration.

Thursday’s vote marked the second time this week that members of Trump’s party have rebuked him on Capitol Hill. The Senate also voted Wednesday to end U.S. support for the Saudi Arabian-led coalition fighting in Yemen ― a resolution that the White House has similarly threatened to veto.