Republican U.S. Sen. Ron Johnson stuck with President Donald Trump and Democrat Tammy Baldwin opposed one of the president's signature initiatives in a key vote Thursday.

By a 59-41 margin, the U.S. Senate approved a House measure to overturn Trump's emergency declaration over the U.S.-Mexico border.

The president declared the emergency so that he could free up funds for construction of a border wall. Trump is seeking to tap into more than $6 billion for construction that Congress set aside for other programs, most of them at the Pentagon.

Baldwin joined all Democrats and 12 Republicans in voting to overturn the emergency declaration, a sharp rebuke for the president. Johnson voted against the bill, setting the stage for Trump to issue the first veto of his presidency.

Johnson faults Democrats

Johnson cast blame on Democrats.

"Unfortunately, securing America's border has turned into a political brawl, with Democrats — who supported border barriers in the past — now refusing to supply the funding for necessary barriers because they don't like this president," Johnson said in a statement. "We have a growing humanitarian crisis at our border that has seen more families and unaccompanied children enter our country in the last five months than at any other time on record. That certainly qualifies as an emergency."

Johnson said Thursday's vote "will not fix any problem, but it does demonstrate whether a senator supports or opposes border security. I will always choose to support border and homeland security."

Johnson, who chairs the U.S. Senate Homeland Security and Governmental Affairs Committee, said he'll take a look at dealing with the issue of "reclaiming congressional authority under the National Emergencies Act."

Baldwin said she supports strengthening border security but voted for the resolution of disapproval "because President Trump’s unlawful power grab is an attack on our Constitution’s separation of powers."

Baldwin added: "Our Constitution is very clear that Congress has the power of the purse and President Trump can’t just steal the purse and spend money on whatever he wants. I support the Senate resolution of disapproval and I voted to stand up for our Constitution and our American system of checks and balances.”

Senate Minority Leader Chuck Schumer, D-N.Y., noted that the National Emergencies Act allows Democrats to bring the resolution back to the floor every six months, forcing Republicans to repeatedly revisit the tough vote — "and certainly we intend to do that."

Republican senators such as Utah’s Mitt Romney and Tennessee’s Lamar Alexander said they supported Trump’s desire to build the wall. But they did not want to set a precedent of a president going around Congress for funding lawmakers had rejected.

Congress sent Trump $1.375 billion for the wall in February, far less than he wanted.

In addition to the political symbolism, the vote — and the remarks from Trump's allies — are almost certain to wind up in several federal lawsuits challenging Trump's emergency declaration.

The litigation was one of the arguments GOP senators made as they pressed Trump to take another path to his wall.

"I know the president has the votes to pursue his approach," Ohio Sen. Rob Portman said before the vote. "But I continue to hope the president uses the funds he has available to him without creating a bad precedent, having some of the needed funds tied up in the courts and taking money from important military projects."

The White House has not said specifically which Pentagon projects would be cut to help build the wall. The emergency allows Trump to dip into Defense and other funds that would otherwise be off limits because Congress directed that money for other priorities.

Political wedge issue

The political implication of the Republican defections is also enormous. The rebuke puts on display a wedge within the GOP that Democrats are certain to exploit heading into the 2020 election.

Trump aides also hope to use the issue to fire up supporters. The president's campaign blasted an email Thursday arguing "we must FINISH THE WALL."

White House officials, including Vice President Mike Pence, scrambled behind the scenes to keep the number of Republicans votes low. Trump signaled shortly before the vote that he could be open to limiting a president's power on future emergencies.

His last-minute efforts may have swayed Sen. Thom Tillis, R-N.C., who fell back in line after announcing in February that he would oppose the emergency.

Shortly before reversing positions and voting to keep the declaration in place, Tillis said the White House was working "in good faith" to amend the National Emergencies Act.

"I, for one, am going to work on that and hopefully gain consensus on a bipartisan basis after the temperatures have cooled," said Tillis, who faces re-election next year.

Maureen Groppe and John Fritze of USA Today contributed to this report.