Donald Trump has issued his first legislative veto since taking office, overruling Congress to protect his declaration of a national emergency to secure funds for a wall on the US border with Mexico.

Trump vetoed the resolution passed by the US Senate on Thursday to reject his declaration of a national emergency. The bill passed the Senate by a margin of 59-41 with 12 Republicans joining Senate Democrats in a rare rebuke of the president.

The bill had passed the House in February with 13 congressional Republicans crossing the aisle to join Democrats.

In the Oval Office at the White House on Friday afternoon, Trump said “our immigration system is stretched beyond the breaking point” and called the congressional action “dangerous” and “reckless”. Trump made the comments surrounded by law enforcement officials and “angel parents”, whose children were killed by undocumented immigrants.

The president had long threatened a veto of the resolution. It is unlikely that Congress will have the two-thirds majority required to override it.

Nonetheless, the House speaker, Nancy Pelosi, announced that the House would vote on 26 March in an effort to override Trump’s veto. In a statement, Pelosi said: “The House will once again act to protect our constitution and our democracy from the president’s emergency declaration by holding a vote to override his veto. House Republicans will have to choose between their partisan hypocrisy and their sacred oath to support and defend the constitution.”

The Senate Democratic leader, Chuck Schumer, also criticized Trump’s action. “It is no surprise that the president holds the rule of law and our constitution in minimal regard,” said the New York Democrat in a statement.

On 15 February Trump invoked the National Emergencies Act of 1976, claiming there was a crisis on the border that required the construction of walls to protect the United States.

Trump declared the national emergency after signing a government funding agreement that did not include the money he requested to build a wall. His signature ended a 35-day partial shutdown of the federal government, which had been triggered by a showdown after Congress refused to appropriate the $5.7bn he requested to start construction at the border. But the compromise reached on funding only included $1.37bn for “barriers” on the border, not a wall, and totaling far less than Trump wanted.

Trump made the construction of a wall along the almost 2,000-mile-long US-Mexico border a cornerstone of his 2016 presidential campaign, saying Mexico would pay for it. The Mexican government has yet to agree to fund the project, and no part of the wall has been built – only repairs and refurbishments to existing barriers have happened in some areas.

The declaration of an emergency allowed the administration to access over $6bn in additional funds not appropriated by Congress to build the wall.

However, Democrats and a number of Republicans said his effort represented an unconstitutional expansion of the power of the presidency. In a statement, the Republican senator Lamar Alexander of Tennessee said: “Never before has a president asked for funding, Congress has not provided it, and the president then has used the National Emergencies Act of 1976 to spend the money anyway.”

The statement continued: “The problem with this is that after a revolutionary war against a king, our nation’s founders gave to Congress the power to approve all spending so that the president would not have too much power. This check on the executive is a crucial source of our freedom.”

Defenders of the Trump administration justified their vote by saying the measure was needed to provide border security. Lindsey Graham, the Republican senator from South Carolina, said: “There is an emergency at our southern border. Military construction funds can be used by President Trump to create barriers to protect our nation from the scourge of illegal immigration. I believe the president is on sound legal ground.”

Under article I, section 7 of the constitution, a veto override requires two-thirds majorities in each chamber. The initial resolution of disapproval did not receive two-thirds support in either the House or the Senate.