WASHINGTON (Reuters) - Bills backed by U.S. President Donald Trump to crack down on illegal immigrants passed the U.S. House of Representatives on Thursday, drawing criticism from immigration activists and others who called them a threat to civil liberties.

The House voted 228-195 to pass the “No Sanctuary for Criminals Act” that would withhold some federal grants to so-called “sanctuary city” jurisdictions that do not comply with certain federal immigration laws.By a vote of 257-167, the chamber also passed “Kate’s law” to increase penalties for illegal immigrants who return to the United States. It is named for Kate Steinle, who was shot dead in San Francisco in 2015. An illegal immigrant who had been deported five times was charged with her murder.

“I applaud the House for passing two crucial measures to save and protect American lives,” Trump said in a statement. “These were bills I campaigned on and that are vital to our public safety and national security.”

Both bills will need approval from the Senate to become law. Trump’s Republicans control both chambers. But Democrats assailed the measures as fear-mongering.

“Although people who illegally re-enter the country do so to reunite with their families, or to flee violence or persecution, this bill considers them all dangerous criminals who deserve lengthy prison sentences,” Democratic Representative Jerrold Nadler said during debate on “Kate’s Law.”

During the 2016 presidential campaign, Trump demanded action against sanctuary cities, which provide some protection for illegal immigrants under laws that limit how much cooperation local police may have with federal immigration authorities.

The “No Sanctuary for Criminals Act” prohibits sanctuary cities from adopting policies that restrict police officers from asking individuals about their immigration status or the immigration status of others.

Under the laws, illegal immigrants would face mandatory detention for past convictions of an expanded number of offenses, such as driving under the influence of drugs or alcohol.

On Wednesday, Trump promoted both bills at the White House with speeches by parents of young people slain by people who live in, or immigrated to, the United States illegally.