The lifting of a pandemic-era restriction that turned away many migrants at the U.S. border has ignited fierce debates within the Democratic Party over immigration and border security, exposing raw intraparty divisions over an issue that Democrats often find difficult to navigate.

As U.S. officials brace for a rise in illegal crossings at the southern border after the expiration of the measure, known as Title 42, Democrats are grappling with competing political demands, seeking to address the intensification of a long-running humanitarian crisis and in some cases flexing their border security bona fides.

Mayors, members of Congress and other Democrats have demanded more federal support for their cities, districts and states. Some have sharply rebuked the Biden administration’s decision to send troops to the border while applauding the end of the Trump-era border policy but worrying about what will replace it. And several moderate Democrats, by contrast, have criticized the White House’s decision to lift Title 42, sometimes pursuing efforts to extend it.

Taken together, the moment underscores the crosscurrents President Biden faces within his party as he slowly begins his re-election campaign and the challenges that await many Democrats in competitive races next year.

“It’s a tough issue because it’s a complex issue,” said Representative Veronica Escobar, a Democrat from El Paso, a border city that declared a state of emergency before the lifting of Title 42.

“For Republicans, it comes down to three words: Build the wall,” Ms. Escobar said, faulting Republicans for torpedoing past immigration overhaul proposals. For Democrats, she acknowledged, the messaging is more challenging.

“We want to talk about the multifaceted approach that it takes to address this,” she said, adding that sometimes, “we lose people in the process, because everybody is looking for a quick, easy sound bite.”

Republicans have often used border security and the arrivals of immigrants to fire up their base, at times deploying racist conspiracy theories. But that strategy has had inconsistent results in recent general elections.

And the White House has blamed Republicans for opposing Mr. Biden’s efforts to pass immigration legislation.

But an array of recent polls illustrate the political dangers for Democrats on immigration. A Reuters/Ipsos poll found that 60 percent of Americans disapproved of Mr. Biden’s handling of immigration; a similar share of registered voters in a Fox News poll said the same. It’s also an issue that alarmed Mr. Biden’s lead pollster early in his presidency.

“It starts with a safe and secure border and communicating what you’re doing to ensure there’s a safe and secure border, while at the same time providing a humanitarian and responsible way to become a United States citizen,” said Dan Sena, a former executive director of the House Democratic campaign arm, the first Hispanic person to have held that position.

Both priorities, he said, “from a messaging perspective and from an actual policy perspective, need to move together in unison.”

In the days surrounding the lifting of Title 42, some Democrats have sought to strike that balance, arguing that there should be no conflict between supporting border security and demanding compassion for asylum seekers. Title 42, a public health rule, had allowed Border Patrol agents to turn away migrants rapidly, without providing most with the chance to seek asylum — and in the immediate aftermath of the lifting of the order, the scenes of chaos some had worried about did not materialize.

But some moderate Democrats running in competitive races — like Senator Jon Tester of Montana — have argued against lifting Title 42 for now, as they seek to combat Republican attacks that Democrats are weak on border security.

“We can have law and order at the border, and still be respectful of immigrants and their rights and treat them with respect and dignity,” said Representative Henry Cuellar, a conservative Texas Democrat who offered a mixed assessment of how the Biden administration had handled the rollback.

Janet Napolitano, a homeland security secretary during the Obama administration, recalled the pressures the White House had faced from various factions of the Democratic Party when increased numbers of Central American children crossed the border in 2014.

“Democrats have a much broader spectrum to cover, from those that are in what I would call the immigration advocacy community, to those who I would consider the pragmatic moderates and everything in between,” Ms. Napolitano said.

Ms. Napolitano, who describes herself a pragmatist on immigration, said she had also confronted these tensions as attorney general and governor of Arizona.

“There are those who believe sincerely and honestly that the United States should not deport people,” Ms. Napolitano said. “And there are those who believe that’s not realistic nor does it fully respect the sovereignty of the United States.”

Progressive Democrats have previously voiced frustration over Mr. Biden’s reliance on Title 42, especially given his criticism during the 2020 campaign of former President Donald J. Trump’s aggressive approach to migrants, which included separating families. And some suggest that moderates in their party are mistakenly ceding ground to Republicans on the issue.

“We are allowing, in some cases, Republicans to win the conversation about immigration and asylum seekers,” said Representative Delia Ramirez, a left-leaning Democrat from Chicago, whose mother crossed the border while pregnant with her.

She urged her party to embrace policies including directing more emergency funding to cities that are absorbing undocumented immigrants, making efforts to keep undocumented families together, and pursuing “flexible and expedited work permits” that could combat labor shortages.

Many of the people arriving at the border want to work, she stressed.

Latino voters “have said to me over and over, neither party has actually delivered,” she said. “We have an opportunity to deliver.”

Mr. Biden’s plan to replace Title 42 with a so-called transit ban has also angered some of his fellow Democrats. This new rule would make migrants who fail to apply for protection in a nation on their way to the border ineligible for asylum within the United States.

“The transit ban is a problem,” said Representative Adriano Espaillat, Democrat of New York. “The traditional asylum-seeking model should not be altered or mutilated with these new policies.”

Some mayors of major liberal cities have expressed other concerns about managing the flow of migrants into their cities. Mayor Eric Adams of New York has been strikingly critical of the Biden administration.

And Mayor Muriel Bowser of Washington, D.C., privately conveyed to the White House that she was much more concerned than she had let on about migrants’ being dropped off in the city last year, according to a former White House official. A representative for Ms. Bowser did not respond to a request for comment.

“It’s a prickly, prickly subject,” Mr. Sena said.