DETROIT—The ideological divisions gripping the Democratic Party intensified on Wednesday as presidential candidates waged an acrimonious battle over health care, immigration and race that tested the strength of early front-runner Joe Biden’s candidacy.

The former vice president was repeatedly forced to defend his decades-old political record against pointed attacks from his younger, diverse rivals, who charged that Biden’s eight-year relationship with President Barack Obama was not reason enough to earn the Democratic nomination.

The attacks on Biden in the second presidential debate were most vivid coming from California Sen. Kamala Harris, who declared that his willingness to work with segregationists in the U.S. Senate during the 1970s could have had dramatic consequences on the surge of minority candidates in political office. And, she said, it could have prevented her and fellow presidential candidate Cory Booker, both of whom are black, from becoming senators.

“Had those segregationists had their way, I would not be a member of the United States Senate, Cory Booker would not be a member of the United States Senate, and Barack Obama would not have been in a position to nominate” Biden to become vice president, she said.

When pressed, Biden repeatedly leaned on his relationship with Obama.

“We’re talking about things that occurred a long, long time ago,” Biden said. “Everybody’s talking about how terrible I am on these issues. Barack Obama knew who I was.”

The dynamic showcased the challenges ahead for Biden and his party as Democrats seek to rebuild the young and multiracial coalition that helped Obama win two presidential elections. Those differences were debated on a broad menu of issues including health care, immigration and women’s reproductive rights.

But it was the discussion of race that marked an escalating rift shaping the Democratic primary. At the same time, polls show that Biden has far more support from minority voters than his challengers, especially in the crucial early voting state of South Carolina.

Booker, who at times adopted the position of peacemaker, also took Biden to task over criminal justice issues and his role in passing a crime bill while a Delaware senator in the 1990s. When Biden fought back by criticizing Booker’s tenure as mayor of Newark, New Jersey, before becoming a New Jersey senator, Booker shot back: “You’re dipping into the Kool-Aid and you don’t even know the flavor.”

In Detroit, a city where Democrats desperately need strong minority turnout to beat President Donald Trump next year, Biden, 76, repeatedly clashed with the two black candidates in the race, as well as the only candidate of Mexican heritage, all of whom are more than two decades his junior. Biden emphasized his work as vice president to help the auto industry and the city repair its bankrupt finances.

For Democrats, the internal fight, while common to almost every primary cycle, is one many would rather avoid, favoring instead a focus on defeating Trump. Several candidates said they thought Trump should be impeached and others called him a racist.

“The first thing I am going to do is Clorox the Oval Office,” New York Sen. Kirsten Gillibrand said.

Biden’s struggling 2020 competitors see no better way to undermine his candidacy than raising questions about his commitment to black voters and women.

Anticipating a rough night, Biden greeted Harris onstage by quipping, “Go easy on me, kid.”

She did not — and he often responded in kind.

Biden charged that Harris’ health care plan would cost taxpayers $3 trillion even after two terms in office and would force middle-class taxes to go up, not down. He said that would put Democrats at a disadvantage against Trump.

“You can’t beat President Trump with double talk on this plan,” he said.

Harris slapped back that Biden was inaccurate.

“The cost of doing nothing is far too expensive,” Harris said. She added: “Your plan does not cover everyone in America.”

For the first time in the months-old Democratic contest, Harris faced pointed attacks on her plan to provide universal health care. Harris faced criticism from all sides this week after releasing a competing plan that envisions a role for private insurance with strict government rules, but she wants to transition to a single-payer government-backed system within 10 years.

And she was also challenged for her record as a prosecutor and California’s attorney general, notably by Rep. Tulsi Gabbard of Hawaii.

“Sen. Harris says she’s proud of her record as a prosecutor and that she’ll be a prosecutor president, but I’m deeply concerned about this record,” Gabbard said. “Too many examples to cite, but she put over 1,500 people in jail for marijuana violations and laughed about it when she was asked if she ever smoked marijuana.”

There were also tense exchanges on immigration that pitted Biden against former Obama housing secretary Julián Castro, the only Latino candidate in the race.

Biden suggested that some of his rivals favor immigration laws that are far too forgiving. Castro, for example, would decriminalize illegal border crossings.

“People should have to get in line. That’s the problem,” Biden said.

Castro shot back: “It looks like one of us has learned the lessons of the past and one has not.”

Biden did have a defender of sorts in Sen. Michael Bennet of Colorado, who derided the cost and impact of “Medicare for All” on middle-class families and those with private health insurance.

While the first primary votes won’t come for six more months, there is a sense of urgency for the lower-tier candidates to break out. More than half the field could be blocked from the next round of debates altogether — and possibly pushed out of the race — if they fail to reach new polling and fundraising thresholds implemented by the Democratic National Committee.

The dire stakes have forced many Democrats to turn against one another in recent weeks. But their common focus was how they characterized Trump’s impact on American life.

One of them, Washington Gov. Jay Inslee, was particularly blunt.

“We can no longer allow a white nationalist to be in the White House,” he said.

___

Peoples reported from Washington. Associated Press writers Thomas Beaumont in Detroit and Colleen Long in Washington contributed to this report.