Warning of threats to public safety and national security, the Republican-led House has approved two bills to crack down on illegal immigration, a key priority for President Donald Trump.

One bill would strip federal dollars from self-proclaimed “sanctuary” cities that shield residents from federal immigration authorities, while a separate measure would stiffen punishments for people who re-enter the US illegally.

The sanctuary measure was approved 228-195, while the bill to punish deportees was approved 257-167. Three Democrats joined all but seven Republicans to pass the sanctuary measure, while 24 Democrats backed the deportee bill. Representative Justin Amash of Michigan was the only Republican who opposed the deportee bill. The bills now go to the Senate.

Mr Trump, who often railed against illegal immigration during his presidential campaign, hailed passage of the House bills and urged the Senate to act “save American lives.” Mr Trump met at the White House this week with more than a dozen family members of those killed by people in the country illegally.

“Opposing these bills, and allowing dangerous criminals back into our communities, our schools and the neighbourhoods where our children play, puts all of us at risk,” Mr Trump said.

One of the bills, known as “Kate's Law,” would impose harsher prison sentences on deportees who re-enter the United States. The bill is named after 32-year old Kathryn Steinle, who was shot and killed in San Francisco in 2015 by a man who was in the country illegally. Juan Francisco Lopez-Sanchez, who pleaded not guilty to the crime, had been released by sheriff's officials months earlier despite a request by immigration officials to keep him behind bars.

The second bill would bar states and localities that refuse to cooperate with immigration authorities from receiving certain Justice Department and Homeland Security grants, including some related to law enforcement and terrorism.

The controversial orders Donald Trump has already issued Show all 9 1 /9 The controversial orders Donald Trump has already issued The controversial orders Donald Trump has already issued Trump and the media White House Press Secretary Sean Spicer takes questions during the daily press briefing Getty Images The controversial orders Donald Trump has already issued Trump and the Trans-Pacific Partnership Union leaders applaud US President Donald Trump for signing an executive order withdrawing the US from the Trans-Pacific Partnership negotiations during a meeting in the Roosevelt Room of the White House in Washington DC. Mr Trump issued a presidential memorandum in January announcing that the US would withdraw from the trade deal Getty The controversial orders Donald Trump has already issued Trump and the Mexico wall A US Border Patrol vehicle sits waiting for illegal immigrants at a fence opening near the US-Mexico border near McAllen, Texas. The number of incoming immigrants has surged ahead of the upcoming Presidential inauguration of Donald Trump, who has pledged to build a wall along the US-Mexico border. A signature campaign promise, Mr Trump outlined his intention to build a border wall on the US-Mexico border days after taking office Getty Images The controversial orders Donald Trump has already issued Trump and abortion US President Donald Trump signs an executive order as Chief of Staff Reince Priebus looks on in the Oval Office of the White House. Mr Trump reinstated a ban on American financial aide being granted to non-governmental organizations that provide abortion counseling, provide abortion referrals, or advocate for abortion access outside of the United States Getty Images The controversial orders Donald Trump has already issued Trump and the Dakota Access pipeline Opponents of the Keystone XL and Dakota Access pipelines hold a rally as they protest US President Donald Trump's executive orders advancing their construction, at Columbus Circle in New York. US President Donald Trump signed executive orders reviving the construction of two controversial oil pipelines, but said the projects would be subject to renegotiation Getty Images The controversial orders Donald Trump has already issued Trump and 'Obamacare' Nancy Pelosi who is the minority leader of the House of Representatives speaks beside House Democrats at an event to protect the Affordable Care Act in Los Angeles, California. US President Donald Trump's effort to make good on his campaign promise to repeal and replace the healthcare law failed when Republicans failed to get enough votes. Mr Trump has promised to revisit the matter Getty Images The controversial orders Donald Trump has already issued Donald Trump and 'sanctuary cities' US President Donald Trump signed an executive order in January threatening to pull funding for so-called "sanctuary cities" if they do not comply with federal immigration law AP The controversial orders Donald Trump has already issued Trump and the travel ban US President Donald Trump has attempted twice to restrict travel into the United States from several predominantly Muslim countries. The first attempt, in February, was met with swift opposition from protesters who flocked to airports around the country. That travel ban was later blocked by the Ninth Circuit Court of Appeals. The second ban was blocked by a federal judge a day before it was scheduled to be implemented in mid-March SANDY HUFFAKER/AFP/Getty Images The controversial orders Donald Trump has already issued Trump and climate change US President Donald Trump sought to dismantle several of his predecessor's actions on climate change in March. His order instructed the Environmental Protection Agency to reevaluate the Clean Power Plan, which would cap power plant emissions Shannon Stapleton/Reuters

Representative Bob Goodlatte the Republican chairman of the House Judiciary Committee, said the two bills would help “avoid the kind of tragic circumstances that have totally involved the lives of the people who were at the White House ... speaking up for their loved ones.”

The sanctuary measure follows “a simple principle that if you're going to receive taxpayer dollars from the federal government to keep people safe, that you've got to follow the law and keep them safe,” Mr Goodlatte said.

Democrats said the bills were feel-good measures intended to make lawmakers look tough on crime. “We're not doing bumper stickers here. We are doing laws,” said Representative Zoe Lofgren, a Democrat from California.

She and other Democrats said the sanctuary measure was “about telling people how to police their cities” and telling local officials that “we in Washington, DC, know better than you do.”

Homeland Security Secretary John Kelly said he appreciates Congress' effort to “address the dangers of sanctuary cities and illegal immigrant offenders.”

At a news conference at the Capitol with House Speaker Paul Ryan, Mr Kelly said his agency “will enforce the laws that are passed by Congress,” adding, “I am offended when members of this institution put pressure and often threaten me and my officers to ignore the laws they make.”

A spokesman said later that Mr Kelly “will continue to push back against any attempt — pressure, threat or otherwise — to ignore the enforcement of immigration law.”

“Enforcement is not selective, occasional or arbitrary, it's the law,” spokesman David Lapan said.

The Justice Department's inspector general has identified California and major cities such as Chicago, New York and Philadelphia as locales with barriers to information-sharing among local police and immigration officials. The Trump administration warned nine jurisdictions in late April that they could lose coveted law enforcement grant money unless they document cooperation.

Attorney General Jeff Sessions, who met with the families at the Department of Justice, said Ms Steinle “would still be alive today if only the city of San Francisco had put the public's safety first. How many more Americans must die before we put an end to this madness?”

Representative Luis Gutierrez, a Democrat from Illinois, said “Kate's Law” would not have had an impact on the Steinle case, noting that Ms Steinle was killed in July 2015 by an immigrant who had been mistakenly released by the federal Bureau of Prisons.

The proposed bill “would not have kept Kate Steinle's killer off the streets,” Mr Gutierrez said. “Instead, we are voting on a bill to put other people — in different circumstances — in jail for longer periods of time. It is a bait-and-switch strategy: Use a horrible tragedy to sell a policy that would not have prevented that death, so that you put more immigrants in jail for longer periods of time.”