Just as Mr. Obama’s term was ending, hundreds of thousands of Central American migrants were showing up at the border, many of them unaccompanied minors seeking asylum. In response, his administration put considerable effort into broadcasting one message to families sending children on their own: stop.

Then, Mr. Trump’s anti-immigration rhetoric helped send him to the White House.

“There is no doubt that the tenor on immigration has shifted in the last couple of years, but it sounds really different because Trump is being so extreme on his policies,” said Lanae Erickson, a senior vice president at Third Way, a centrist Democratic think tank based in Washington. Democrats need to react to the extremism, Ms. Erickson said, without leaving themselves open to being accused of their own extremism. “We gave him some more fodder for those ads,” she said, referring to how this past week’s debates might help Mr. Trump’s campaign.

Now the presidential candidates need to offer solutions on immigration policy, Ms. Erickson said, and “explain themselves and pair that with what they are going to do on the security side. That needs to be a piece of the Democratic policy in equal measure.”

Until now, the discussion of details about laws along the border tended to be more technical than ideological. One section of immigration law makes it possible to criminally convict anyone who crosses the border illegally. The law enabled the Trump administration to enact its “zero tolerance” policies to separate parents and their children, which was widely condemned by members of both parties.

Julián Castro, the former mayor of San Antonio, was the first candidate to propose repealing the section on criminal convictions when he released his immigration plan in April. During Wednesday’s debate, Mr. Castro asked the other Democratic candidates to support his idea. Mr. Castro went on to attack Beto O’Rourke, a former congressman from El Paso, Tex., for not backing the idea.

[Julián Castro Is Crowned the Winner on Telemundo’s First Debate Night]

By Thursday, the question had already appeared to become a litmus test among the Democratic hopefuls.

“The day for Democrats straddling this debate is gone,” said Howard Dean, the former chairman of the Democratic National Committee. “Now the question is, ‘Are you decent or not? Are you going to behave like Trump or not?’ He’s polarized the country and he’s really caused this shift.”