The House of Representatives has narrowly voted to impeach Homeland Security Secretary Alejandro Mayorkas, making him the first cabinet member to face impeachment in nearly 150 years.

Many Republicans blame Mr Mayorkas for an unprecedented influx of migrants at the US-Mexico border.

The Republican-led chamber voted 214 to 213 for the measure, after an earlier attempt failed last week.

The issue now heads to the Democratic-led Senate, where it is likely to fail.

President Joe Biden on Tuesday called the vote a “blatant act of unconstitutional partisanship” and a “political stunt”.

The vote was largely divided along party lines, with 210 Democrats voting against the impeachment, along with three Republican representatives: Tom McClintock of California, Ken Buck of Colorado and Mike Gallagher of Wisconsin.

The three Republican defectors also voted against the first attempt to impeach Mr Mayorkas.

More than 6.3 million migrants have entered the US illegally since 2021, making immigration a divisive and politically contentious issue ahead of the November election.

Opponents of Mr Biden’s administration have accused Mr Mayorkas of not living up to his oath to “well and faithfully discharge the duties” of his office by failing to do more to secure the border.

Democrats and the administration have denied the charges.

In a statement released shortly after the vote, Mr Biden defended Mr Mayorkas, calling him “an honourable public servant”.

“Homeland Security Secretary Mayorkas, a Cuban immigrant who came to the United States with his family as political refugees, has spent more than two decades serving America with integrity in a decorated career in law enforcement and public service,” the president said.

“He has upheld the rule of law faithfully and has demonstrated a deep commitment to the values that make our nation great.”

Mr Biden also criticised Republicans for pushing a “baseless impeachment” instead of working on passing bipartisan solutions on the border.

Republican Speaker of the House Mike Johnson said Mr Mayorkas “deserves to be impeached”.

“Next to a declaration of war, impeachment is arguably the most serious authority given to the House and we have treated this matter accordingly,” he said in a statement following the vote.

Over the course of two hearings in January, Republicans charged Mr Mayorkas with failing to enforce existing immigration policies and lying about the border’s security. He did not testify.

An earlier attempt to impeach Mr Mayorkas in the House narrowly failed.

One of the Democratic representatives, Al Green of Texas, appeared to vote unexpectedly after being wheeled into the chamber wearing hospital scrubs to vote against the impeachment. He had been in an emergency room having surgery.

Tuesday’s vote, however, saw the return of House Majority Leader Steve Scalise, who was being treated for cancer during the last vote. Mr Scalise’s return gave Republicans the narrow margin they needed to secure the vote.

Impeachment – a process outlined in the US Constitution – marks the first step in removing a federal official for high crimes or misdemeanours.

It requires a simple majority in the 435-member House. This then triggers an impeachment trial in the Senate, but a two-thirds majority in the 100-member Senate is needed for it to succeed.

There impeachment effort is unlikely to pass as the Senate is narrowly controlled by the Democrats.

The last cabinet secretary to be impeached was Secretary of War William Belknap in 1876, although he resigned and left office shortly ahead of the vote.

The impeachment comes amid rising public concern over US immigration and the administration’s handling of the border.

A January poll conducted by CBS – the BBC’s US partner – suggests that nearly half of Americans view the situation at the border as a crisis, with 63% saying that the administration should adopt “tougher” policies.