Washington (CNN) House Republicans joined President Donald Trump on Thursday afternoon in declaring war on sanctuary cities -- passing legislation targeting the cities' funding while hammering a message of the dangers posed by undocumented immigrants.

The " No Sanctuary for Criminals Act " would expand what is required of cities regarding federal immigrant enforcement and allow the government to deny jurisdictions federal law enforcement funds if they don't comply. It passed 228-195.

Republicans relentlessly hammered a message of restoring "rule of law" Wednesday and Thursday leading up to the vote, highlighting crimes committed by undocumented immigrants and attacking sanctuary cities for lax policies they blame for the crimes.

Trump on Wednesday met with families of victims of crimes committed or allegedly committed by undocumented immigrants, highlighting their deaths as preventable. Attorney General Jeff Sessions did the same on Thursday, and House Speaker Paul Ryan brought Homeland Security Secretary John Kelly to join him at his weekly press conference also Thursday to drive home the message.

"Sanctuary cities are anything but safe," Kelly said, carrying on the theme. "Instead these are places that allow some criminals to go free."

"By flagrantly disregarding the rule of law, sanctuary cities are putting lives at risk," Ryan echoed. "And we cannot tolerate that."

Democrats accused their colleagues of distorting the issue. Local jurisdictions and law enforcement agencies have argued that their policies are actually about making communities safer -- by building trust with local communities -- and say that what the government is actually trying to do is co-opt their precious resources to carry out what should be federal officers' job.

"That's just bogus," said California Rep. Zoe Lofgren when asked by CNN about Republicans' claim that sanctuary cities harbor criminals. "(Immigration and Customs Enforcement) has a job to enforce immigration laws, there's nothing that any state or locality can or should do to prevent them from enforcing immigration laws. What they want to do is commandeer state and locals to do their job for them, and a lot of police departments object to that because they need to build trust with communities."

Democrats also slammed what they alleged was an effort to vilify undocumented immigrants, despite studies showing they are no more likely to commit crimes than the general population.

"This bill perpetuates the ugly myth that immigrants are more dangerous and more likely to commit crimes than native Americans," New York Rep. Jerry Nadler said on the House floor. "This bill demonizes immigrants, punishes communities that seek to build trust between immigrants and law enforcement and allows indefinite detention, ... all while making us less safe."

The sponsor of the bill, Virginia Rep. Bob Goodlatte, said that sanctuary cities are making the choice themselves to ignore safety.

"It is a simple principle that if you are going to receive taxpayer dollars from the federal government to keep people safe, that you have got to follow the law and keep them safe," Goodlatte told reporters Thursday. "That's the reason why we do that."

But it is unlikely the bills will pass the Senate.

Kate's Law has been introduced before and failed to get the 60 votes needed to advance in the Senate last year. It did pick up three Democratic votes -- Indiana Sen. Joe Donnelly, North Dakota Sen. Heidi Heitkamp and West Virginia Sen. Joe Manchin -- but to pass the Senate, Republicans would need five more Democrats to join all Republicans in voting yes.

Other red-state Democrats have already voted against the bill. The sanctuary cities bill could garner even less support, as lawmakers protest the cuts in law enforcement funding.