Homeland Security Secretary John F. Kelly speaks during a Capitol Hill news conference with House Speaker Paul D. Ryan. (Andrew Harrer/Bloomberg News)

The House on Thursday passed two hard-line immigration bills that would penalize illegal immigrants who commit crimes and local jurisdictions that refuse to work with federal authorities to deport them.

Both bills, Kate’s Law and the No Sanctuary for Criminals Act, passed on largely party-line votes amid heavy promotion from Republicans, starting with President Trump.

“MAKE AMERICA SAFE AGAIN!” Trump tweeted as the House debated the bills Thursday, one of five tweets he pushed out to his 35 million followers highlighting the legislation.

Before the vote, Trump urged lawmakers to pass the bill during remarks at the Department of Energy, calling them “vital to public safety and national security.”

Homeland Security Secretary John F. Kelly appeared on Capitol Hill ahead of the vote Thursday with House Speaker Paul D. Ryan (Wis.) and other Republican leaders to promote the bills.

Kate’s Law, named after a 32-year-old woman shot and killed in 2015 by an illegal immigrant who had been deported five times, steps up prison sentences for criminals who reenter the United States illegally after being convicted and deported.

The No Sanctuary for Criminals Act bars “sanctuary cities” that do not cooperate with federal immigration enforcement from receiving many federal grants and leaves them vulnerable to liability lawsuits from victims of crimes committed by illegal immigrants.

Kelly cast the bills as common-sense measures that would “uphold our nation’s immigration laws and help make our communities more safe.”

“President Trump has been clear that our borders are not open to illegal immigration, that we are a nation of laws, and we will no longer look the other way,” he said. “Well, we will no longer look the other way in the interior, either.”

Kelly said Immigrations and Customs Enforcement has deported nearly 66,000 people known to be or suspected of being in the country illegally — representing a spike under Trump administration policies. Nearly half of those, he said, were charged with crimes or “had gang affiliations.”

On the House floor,…