For an issue as thorny and vexing as immigration policy, a question during the Democratic debate Thursday was remarkably clear.

“Raise your hand if you think it should be a civil offense rather than a crime to cross the border without documentation?” José Díaz-Balart, one of the moderators, asked.

Eight candidates raised their hands, some more eagerly than others. Former Vice President Joe Biden raised a finger.

When pressed by Díaz-Balart about whether he would deport undocumented immigrants without a criminal record, Biden did little to clarify his specific stance, instead defending the Obama administration’s policies that deported roughly 3 million undocumented immigrants.

He praised former President Obama’s record on immigration and said: “To compare him to what this guy is doing is absolutely, I find close to immoral.” He added: “We should fundamentally change the way we deal with things.”

That even Biden endorsed changing the law showed just how much ­Democrats’ stances on immigration have changed since “this guy” — that would be President Donald Trump — took office. And nearly all the Democratic hopefuls in last week’s debates offered a sharp example of how the Trump administration’s immigration policies have pushed Democrats to the left, embracing ideas that would have been seen as unthinkable before the Trump presidency.

The debates, in which there were almost unanimous embraces by the top-polling candidates for decriminalizing illegal border crossings and for offering undocumented immigrants health insurance, excited many in the Democratic base. But the debates also raised questions about whether the Democratic candidates were entering terrain that would be perilous in a general election.

Trump seemed to think so, taking to Twitter almost immediately, writing: “All Democrats just raised their hands for giving millions of illegal aliens unlimited health care. How about taking care of American Citizens first!? That’s the end of that race!”

For more than a decade, politicians from both parties have tried and have failed to overhaul the country’s immigration policies. It proved to be an unsolvable conundrum for the Obama administration. As that administration stepped up border enforcement, and deported far more immigrants than previous administrations, advocates for immigrants labeled Obama “Deporter in Chief.” The creation of Deferred Action for Childhood Arrivals (DACA) in 2012 allowed millions of young immigrants to work and to consider themselves secure in America.

Just as 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, Trump’s anti-immigration rhetoric helped send him to the White House.

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 from 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, Castro asked the other Democratic candidates to support his idea. Castro went on to attack Beto O’Rourke, a former congressman from El Paso, Texas, for not backing the idea.

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, 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.”

He added: “We’re going to get tarred with open borders no matter what we say.” Still, Dean suggested that Democrats would likely have to refine their position on border security throughout the campaign.