Lawmakers also passed a bill that would increase penalties against deported immigrants who reenter the country illegally. That bill is a response to the 2015 murder of Kate Steinle in San Francisco by an immigrant who had been deported five times and was convicted of seven felonies.

Republicans have tried to pass Kate's Law since then, and are hoping the bill can finally become law under President Trump, who supports it. President Barack Obama had opposed it.

The bill passed 257-167, with the help of 24 House Democrats. The legislation would let judges increase penalties against illegal immigrants who are deported after being convicted of a crime, and who then reenter the country.

"For too long, illegal reentry of criminal entries has been viewed as a minor felony with only a fraction of those repeat offenders ever seeing the inside of a federal courtroom," said bill sponsor and House Judiciary Committee Chairman Bob Goodlatte, R-Va., during floor debate.

"These horrific events must be better deterred and prevented," he said of Steinle's murder.

President Trump, who has supported the bill, praised its passage moments after the vote was called.

"Good news, House just passed #KatesLaw," Trump tweeted. "Hopefully Senate will follow."

Good news, House just passed #KatesLaw. Hopefully Senate will follow. — Donald J. Trump (@realDonaldTrump) June 29, 2017

Under the bill, if a deported alien reentered the U.S. illegally with a felony conviction or three misdemeanors on their record, he or she would go to prison for up to 10 years. Someone who is caught illegally crossing the border after having been deported three or more times would also serve up to 10 years.

Both President Trump and Attorney General Jeff Sessions urged the House to pass the bill, which was sponsored by House Judiciary Chairman Rep. Bob Goodlatte, R-Va.

Republicans said the bill is a common-sense measure aimed at protecting Americans from dangerous immigrants.

During Thursday debate on the bill, House Judiciary Committee Chairman Bob Goodlatte, R-Va., said the bill is simply about "enhancing public safety, securing our borders and restoring the rule of law."

Passage of Kate's Law followed passage of a bill that would let the federal government strip so-called " sanctuary cities" of federal funding if they refuse to cooperate with federal officials on immigration matters. San Francisco, where Steinle was killed, is a self-proclaimed sanctuary city.