WASHINGTON — When President Donald Trump took office in 2017 with promises to crack down on immigration, he was met by widespread protests that filled churches, airports and union halls as Democratic lawmakers vowed to fight the new Republican president at every turn.

The second time around, Democrats helped send an immigration bill to his desk during his first week in office.

Stinging from election losses, the Democratic Party has so far been splintered in responding to Trump’s push against illegal immigration. Yet the party’s soul searching comes as the stakes could hardly be higher. The new president is acting to seal off the U.S.-Mexico border to asylum seekers and deport millions of immigrants who do not have permanent legal status.

“I think Donald Trump has painted the Democratic Party into a corner on immigration, and it’s going to take us a while to get out of the corner,” said Sen. Michael Bennet, D-Colo. “I want us acting out of conviction about what we believe about immigration rather than out of fear.”

On Capitol Hill, a crucial faction of Democrats is looking for places of agreement with Trump.

Between the House and Senate, 58 Democrats voted last week to pass the Laken Riley Act, which requires federal authorities to detain migrants accused of theft, assaulting a police officer, or other crimes that injure or kill someone.

Meanwhile, other congressional Democrats said they spent the past week addressing the fears of and developing resources for those who could be deported. Rep. Juan Vargas, D-Calif., joined a priest in San Diego last weekend, carrying the Eucharist from home to home because so many in the congregation feared to go outside.

For Republicans, the votes on the Laken Riley Act were proof that they had found a winning message — amplified and led by Trump — on illegal immigration. They are planning to continue pushing immigration legislation, as well as a roughly $100 billion package that would enable Trump to do his border and deportation plans.

On Sunday, acting Deputy Attorney General Emil Bove visited Chicago to witness the start of immigration enforcement in the nation’s third-largest city promised by the Trump administration, but few details were made public.

Democratic senators willing to back tougher enforcement could be crucial. It takes support from 60 senators to advance most legislation, meaning that at least a few Democrats will need to be on board. Republicans have a 53-47 majority.

When asked about Democratic votes for the legislation, the party’s leader in the House, New York Rep. Hakeem Jeffries, was circumspect.

“House Democrats are going to continue to make decisions based on what’s right for the districts that we represent, and the politics will take care of themselves,” he said.

Since last year, many Democrats have moved to the right on border security after historic numbers of migrants arrived.