WASHINGTON (Reuters) - President Donald Trump issued the first veto of his presidency on Friday to block a measure passed by Democrats and Republicans in Congress that would terminate his emergency declaration for a wall on the U.S. border with Mexico.

The veto, made necessary after a strong and unusual rebuke from members of Trump’s Republican party, capped a week that left Trump politically wounded, at least temporarily, as immigration and his signature promise of a wall become a flashpoint again in the 2020 presidential campaign.

Congress is unlikely to muster the votes to override Trump’s veto, a fact that left White House officials confident despite disappointment that it passed the Republican-controlled Senate at all.

The bipartisan vote on Thursday was a slap at Trump for his decision to circumvent Congress and take money already designated for other programs to pay for a barrier on the southern border.

Twelve Republicans joined Democrats in the Senate to pass the measure, concerned that the president had overstepped his authority.

Trump repeated his view that a crisis existed at the border, called the resolution reckless and said he was proud to veto it.

“As president the protection of the nation is my highest duty. Yesterday, Congress passed a dangerous resolution that if signed into law would put countless Americans in danger, very grave danger,” he said, sitting behind his desk in the Oval Office. “Congress has the freedom to pass this resolution, and I have the duty to veto it.”

Slideshow ( 10 images )

The White House had lobbied heavily for Republicans to back Trump, despite concerns among some about executive overreach and precedent-setting action that a future Democratic president could copy on policies that Republicans oppose. The president, without acknowledging that lobbying, said he had sympathy for those who defied him, adding they did what they had to do.

U.S. Attorney General William Barr said the president’s emergency declaration was legal.

It is being challenged in court as an unconstitutional usurpation of Congress’ power of the purse.

Democratic Speaker of the House of Representatives Nancy Pelosi said her chamber would vote on March 26 to override the veto.

“The House and Senate resoundingly rejected the president’s lawless power grab, yet the president has chosen to continue to defy the Constitution, the Congress and the will of the American people,” she said in a statement.

The Senate would have to vote to override the veto as well, requiring more Republicans than the original 12 to sign on, which is unlikely to happen.

Slideshow ( 10 images )

Trump was flanked by border officials and people whose relatives were killed by someone who was in the United States illegally. They praised the president for standing firm on the issue, which resonates strongly with his political base.

Researchers have said that immigrants are less likely to commit crimes, despite Trump repeatedly linking immigration and crime.

The president has said he wants a wall to prevent immigrants from crossing into the United States illegally. Democrats deny there is an emergency at the border, saying border crossings are at a four-decade low.

Trump thanked Republican senators who voted for his declaration in a Twitter post earlier on Friday. “Watch, when you get back to your State, they will LOVE you more than ever before!” he said.

Trump made a border wall a central promise of his 2016 campaign for the White House. He initially insisted that Mexico would pay for the wall but it has declined to do so. Last year, Trump forced a government shutdown over an impasse with Congress over funding for the barrier.

When a deal to prevent another shutdown did not give him the funding he requested, Trump declared a national emergency, redirecting funds that were allocated for other projects to build the barrier instead.