A pair of enforcement bills targeting “sanctuary” cities and undocumented immigrants with prior deportations easily passed the House on Thursday, but they face an uphill climb in the Senate.

The bills are the first major pieces of immigration legislation taken up by the Republican-led Congress since President Donald Trump took office. Unlike former President Barack Obama, who had threatened to veto such measures, Trump has said he would sign both bills.

But votes in the Senate as recently as last year have shown that measures dealing with immigration policy on a piecemeal basis, especially those viewed by Democrats as racially motivated and aimed at broadly painting immigrants as dangerous, are not likely to meet the Senate’s 60-vote threshold required to advance most legislation.

“To the extent that 60 [votes are still required], I would expect we’d be able to sustain,” New Jersey Democratic Sen. Robert Menendez said.

Menendez, a member of the bipartisan “gang of eight” that helped usher a comprehensive immigration overhaul bill through the Senate in 2013, acknowledged that while some Democrats chose to vote with Republicans on enforcement bills in the past, “many more did not.”

Last year, Senate Democrats succeeded in blocking two bills that bore striking similarities to those passed by the House on Thursday. But they saw defections from Sens. Joe Manchin III of West Virginia, Heidi Heitkamp of North Dakota, and Joe Donnelly of Indiana, all of whom are among a group of 10 incumbent Democrats facing re-election battles in states won by Trump last fall.

With 52 members in their conference, Republicans would need to attract the votes of eight Democrats.

Sen. Bob Casey, a Democrat running up for re-election in Pennsylvania — a state that Trump won — noted that he had voted against both bills last year despite the threat of being tagged as “soft on crime” or “soft on illegal immigration” by a GOP opponent.

“I have no doubt the attack is coming,” he said. “They’re right out of the Republican playbook.”

Liberal House Democrats such as Rep. Luis V. Gutierrez are nervous about the prospect of the bills going to the Senate floor. The Illinois lawmaker urged his moderate Senate colleagues to oppose them.

“Sometimes Democrats have to stand up for justice and against racial profiling when it is the right thing to do and the chips are down,” he said on the House floor Thursday. “Well, the chips are down. Every Latino family and every immigrant is going to remember who stood up for them.”

House Republicans pushed back on the anti-immigrant narrative, portraying the bills throughout the week as a way to crack down on criminals and local governments that protect them. They received a boost from Homeland Security Secretary John F. Kelly, who appeared at a news conference with Speaker Paul D. Ryan to urge final passage.

“The word ‘sanctuary’ calls to mind some place safe. Instead these cities are places that allow some criminals to go free, undermine federal law enforcement and make our communities less safe,” Kelly said.

The sanctuary cities bill, passed 228-195 by the House, would tighten existing statutes to bar local governments from imposing policies that prohibit police officers “from assisting or cooperating” with federal immigration agents. It would also establish new probable cause standards allowing federal authorities to more easily detain undocumented immigrants held in local jails.

The second bill is named after Kate Steinle, a San Francisco woman who was shot and killed on July 1, 2015, by an undocumented repeat felon with prior deportations. The measure, passed 257-167, would establish new penalties for undocumented immigrants with criminal convictions who re-enter the U.S. illegally after having been previously deported.

Twenty-four House Democrats voted for the measure named after Steinle, as Trump praised passage of these bills.

“The implementation of these policies will make our communities safer,” the president said in a statement. “Opposing these bills, and allowing dangerous criminals back into our communities, our schools, and the neighborhoods where our children play, puts all of us at risk.”