In the first round of the Democratic debate this week, President Trump was barely present — a ghost who went little mentioned as candidates focused on unveiling plans and proposals while introducing themselves to voters.

But during the second night of debate, on Thursday, Trump was the boogeyman whom everyone named — a charlatan, a fraud, a fabulist, a hater of immigrants, a separator of families, a supporter of white supremacists and, in the words of former Colorado governor John Hickenlooper, “the worst president in American history.”

Sen. Kamala D. Harris (D-Calif.) called him “the greatest national security threat to the United States,” while former vice president Joe Biden suggested he was “immoral.”

Sen. Bernie Sanders (I-Vt.) labeled the president “a phony,” “a pathological liar” and “a racist” — all in a single sentence.

The back-to-back debate nights illustrated a stark philosophical divide in the Democratic Party over how best to combat Trump. 

Some candidates are trying to ignore the president as they work to distinguish themselves in a crowded primary field, while others use Trump as a foil in a bid to prove that they are best positioned to beat the president in 2020.

It remains unclear which model voters ultimately will reward. Geoff Garin, a Democratic pollster, said there is “zero risk” in attacking Trump because, “at the end of the day, we know that voters are looking for somebody who has the ability to defeat Trump.”

Thursday’s debate showcased a more forceful and aggressive approach to taking on Trump — a strategy many candidates and strategists said was deliberate. 

Harris, a former prosecutor who had several powerful moments Thursday, has made “prosecuting the case” against Trump a centerpiece of her campaign. Her advisers say Democratic voters are looking for someone who can confront the president directly.

“We do it all,” Harris press secretary Ian Sams said of the criticisms of Trump. “At the end of the day, when you have 23 candidates, you are looking for distinguishing factors, and one of the overriding ones is who can beat him.”

Rep. Eric Swalwell (D-Calif.) said before his Thursday debate appearance that Trump was a primary factor for his candidacy, and he made the case that Democrats should focus closely on the president as a motivating factor.

“I’m on the stage because of Donald Trump, right? That’s why, with a 2-year-old and an 8-month-old, we’re sacrificing that responsibility and fighting for the country because of the threat that he is,” Swalwell said. “So I don’t know how you can ignore him. It’s kind of like you’re covering your ears and saying, ‘La la la.’ Like this isn’t happening. No, this is happening. We should point it out.”

For much of this year, Sanders has been one of the most outspoken of Trump’s critics. He routinely refers to the president as a “racist,” a “sexist” and a “xenophobe” and calls him the worst U.S. president in modern history — lines he echoed Thursday night.

Showing Democratic voters that their candidate can go toe-to-toe with Trump has been a major priority for Sanders advisers. They have built their strategy around trying to convince voters that he stands the best chance of defeating the president in 2020, and Sanders himself has argued that he can carry many of the white, working-class voters who backed Trump in 2016.

Biden also went after the president Thursday but was surprisingly muted compared with some of his past attacks. He has used Trump to try to elevate his candidacy — acting as if he is already in a general-election fight with the Republican. But Biden’s efforts to attack Trump vigorously during the debate seemed to derail as he found himself fighting off sharp criticism from fellow Democrats, including Harris.

At one point, he fumbled one of his familiar attack lines, saying that his first action as president would be to “make sure that we defeat Donald Trump, period.”

On Wednesday, some of the most heated moments came between candidates trailing in the polls — former housing secretary Julián Castro and former Texas congressman Beto O’Rourke, and Reps. Tulsi Gabbard (D-Hawaii) and Tim Ryan (D-Ohio). Candidates mentioned Trump’s name just 20 times, and even the president’s tweets — fired off while he was en route to Osaka, Japan, for the Group of 20 summit — seemed more perfunctory than infused with his trademark zeal. 

On Thursday night, candidates mentioned Trump’s name nearly twice as many times as on Wednesday.

“Should people go after Trump? Yes. Of course they should. He’s the guy we need to beat,” said Philippe Reines, a Democratic strategist who was a top adviser to Hillary Clinton’s 2016 presidential campaign.

“You can go after him and not have it be a high school cafeteria,” he said.

After the first-round debate, Sen. Elizabeth Warren (D-Mass.) talked about steering clear of excessive Trump bashing. “You can’t just make this all about Donald Trump,” she told MSNBC’s Chris Matthews. “He’s an old show that people are getting tired of.”

Attacking Trump “tends to get covered, and it’s an easy applause line,” said Rebecca Katz, a Democratic political strategist, explaining why so many candidates chose to go after him. 

But, she said, there’s a steep downside. “Attacking Trump is something any of them could do,” Katz said. “It doesn’t set them apart.” 

Sen. Amy Klobuchar (D-Minn.) mentioned Trump more than many of her rivals on Wednesday. She said he “just sits in the White House and gloats” as people struggle to pay bills and “has made us less safe” since becoming president. She called his boasts about taking on the pharmaceutical industry “all foam and no beer.” And she accused him of conducting foreign policy in a “bathrobe at five in the morning.” Her closing statement included this declaration: “I’m someone that can win and beat Donald Trump.”

Klobuchar said later that she had expected her competition to talk about Trump more than they did.

“I was actually surprised that other people didn’t do more,” Klobuchar said in a telephone interview Thursday. Voters, she said, repeatedly tell her that their top focus is defeating Trump and that it is important “to show you can beat Donald Trump and show the contrast and start making the case. And that’s what I was doing.”

Washington Gov. Jay Inslee called out Trump during a lightning session Wednesday when each candidate was asked to name “the biggest geopolitical threat” to the United States.

“Donald Trump. And there’s no question about it,” he replied.

The quip — similar to a line Harris delivered the following evening, albeit more forcefully — was unrehearsed but prompted applause. 

Jared Leopold, an Inslee strategist, said that the line was “not something we practiced” but that Inslee thinks Democratic voters are hungry for a candidate who will go toe-to-toe with Trump.

“You do have to explicitly state his name,” Leopold said. “Voters are looking for how you present your message and how it would stack up against Donald Trump on a debate stage.”

On Trump’s team, the consensus after the debate was that Harris and Warren are the two real Democratic front-runners, according to one adviser close to the Trump campaign.

But Trump campaign officials were also gleeful about many of the left-leaning positions to which Democratic candidates committed themselves onstage, including pledges by Harris and Warren to eliminate private health insurance as part of a Medicare-for-all system. (Harris backtracked on Friday, saying she misheard the question.)

At one point, all 10 Democrats at the debate Thursday night said they would allow undocumented immigrants to have access to government health-care plans — a position Trump advisers say will hurt them politically.

“All Democrats just raised their hands for giving millions of illegal aliens unlimited healthcare,” Trump wrote on Twitter from Japan. “How about taking care of American Citizens first!? That’s the end of that race!”

Andy Surabian, a Republican strategist and adviser to Donald Trump Jr., said the two debate rounds produced a smorgasbord of potential Republican attack ads. 

“The ironic part of Thursday night’s debate is that for years and years, Democrats claimed that they weren’t for open borders, that their health-care plans wouldn’t give free health care to illegal immigrants, that they wouldn’t raise taxes on the middle class and that they weren’t coming for America’s guns,” he said. “And in one debate, they did a 180 on all of those things.”

Issues aside, Trump still loomed large — either as a political foe or someone to be deliberately ignored.

Former Maryland congressman John Delaney did not mention Trump during Wednesday’s debate.

“Sometimes I mention Trump, sometimes I don’t,” he said in an interview later. “I think there’s an advantage, because I think what most Democrats care about is beating him.”

Michael Scherer and Matt Viser contributed to this report.