WASHINGTON (Reuters) - The U.S. Senate voted on Wednesday for a second time to end the national emergency on the southern border the president declared in February, a move Donald Trump would almost certainly veto if it reached his desk.

FILE PHOTO: President Donald Trump signs his veto of the congressional resolution to end his emergency declaration to get funds for a border wall during a ceremony in the Oval Office of the White House in Washington, U.S., March 15, 2019. REUTERS/Jonathan Ernst

Trump, with his very first veto, struck down a similar measure that had cleared both the House and Senate in March. Congress was unable to muster the votes to override that veto.

The Senate vote to approve the resolution was 54-41.

Trump declared the emergency on the southern border to circumvent Congress and take money already designated for other programs to pay for his U.S.-Mexico border wall, which he promised to build during his 2016 campaign.

Democratic lawmakers said the move was an unconstitutional power grab that undercut Congress’ power of the purse, or the ability to tax and spend public money for the national government.

Republicans insisted Trump had acted legally under a 1976 law known as the National Emergencies Act, under which previous presidents had declared dozens of emergencies.

The issue landed in the courts and Trump won an early battle in July when the conservative-majority Supreme Court voted 5-4 to block a ruling by a federal judge in California that barred the Republican president from redirecting $2.5 billion in funds.

Congress has refused to meet Trump’s demands to fund a wall, although it has provided some funds for border fencing and other barriers.

This year, Trump sought $5.7 billion in wall funding. When Congress refused, a standoff ensued that triggered a month-long partial government shutdown that ended when the president agreed to $1.37 billion for border barriers, far less than he wanted.

Trump then declared the emergency, vowing to divert funds from other accounts for the wall.