The Republican-run Senate firmly rejected US President Donald Trump’s declaration of a national emergency at the south-west border on Thursday.

They set up a veto fight and dealt him a conspicuous rebuke as he tested how boldly he could ignore Congress in pursuit of his highest-profile goal.

The Senate voted 59-41 to cancel Mr Trump’s February proclamation of a border emergency, which he invoked to spend 3.6 billion dollars (£2.7 billion) more for border barriers than Congress had approved.

Twelve Republicans joined Democrats in defying Mr Trump in a showdown many Republican senators had hoped to avoid because he commands die-hard loyalty from millions of conservative voters who could punish defectors in next year’s elections.

With the Democrat-controlled House’s approval of the same resolution last month, Senate passage sends it to Mr Trump.

He has shown no reluctance to casting his first veto to advance his campaign exhortation “Build the Wall,” which has prompted roars at countless rallies.

Approval votes in both the Senate and House fell short of the two-thirds majorities needed to override.

“VETO!” Mr Trump tweeted minutes after the vote.

Though Mr Trump seems sure to prevail in that battle, it remains noteworthy that members of both parties resisted him in a fight directly tied to his cherished campaign theme of erecting a border wall.

The roll call came just a day after the Senate took a step toward a veto fight with Mr Trump on another issue, voting to end US support for the Saudi Arabian-led coalition’s war in Yemen.

In a measure of how remarkable the confrontation was, Thursday was the first time Congress has voted to block a presidential emergency since the National Emergency Act became law in 1976.

At the White House, Mr Trump did not answer when reporters asked if there would be consequences for Republicans who voted against him.

Presidents have declared 58 national emergencies since the 1976 law, but this was the first aimed at accessing money that Congress had explicitly denied, according to Elizabeth Goitein, co-director for national security at New York University Law School’s Brennan Center for Justice.

Mr Trump and Republicans backing him said there is a legitimate security and humanitarian crisis at the border with Mexico.

They also said Mr Trump was merely exercising his powers under the law, which largely leaves it to presidents to decide what a national emergency is.

The National Emergency Act gives presidents wide leeway in declaring an emergency.

Congress can vote to block a declaration, but the two-thirds majorities required to overcome presidential vetoes make it hard for lawmakers to prevail.