By BRIAN SLODYSKO Associated Press

LOS ALTOS HILLS, Calif. (AP) — Former President Barack Obama warned Democrats on Thursday against adopting “purity tests” in the presidential primary and said any adversity the candidates face in the contest will make whoever emerges an even stronger nominee.

Obama spoke to about 100 donors during a question-and-answer session with Democratic National Committee Chairman Tom Perez in Los Altos Hills, California. The event came a day after the fifth Democratic presidential primary in Atlanta and as the 17-person field continues to expand, with the expected entry of former New York City Mayor Michael Bloomberg in the coming days.

In this Oct. 29, 2019, file photo, former President Barack Obama speaks during the Obama Foundation Summit at the Illinois Institute of Technology in Chicago. Obama reiterated a warning about the adoption of “purity tests” in the Democratic presidential primary, which he said are likely to alienate voters needed to defeat President Donald Trump next year. (Ashlee Rezin Garcia/Chicago Sun-Times via AP)

Until recently, Obama largely refrained from opining publicly on the Democratic contest, and his move from the sidelines comes at a moment of deep uncertainty for the party. Many are jittery about the uneven candidacy of his former Vice President Joe Biden, questioning whether Sens. Bernie Sanders and Elizabeth Warren can defeat President Donald Trump next year, and skeptical of whether Pete Buttigieg, the South Bend, Indiana, mayor who is surging in Iowa, can appeal to Black voters that are a crucial Democratic voting bloc.

“We will not win just by increasing the turnout of the people who already agree with us completely on everything,” Obama said. “Which is why I am always suspicious of purity tests during elections. Because, you know what, the country is complicated.”

Obama urged Democrats to “chill out,” saying, “The truth of the matter is that every candidate on that stage believes we should provide” better health care and education and address climate change.

He also noted the historic diversity of the Democratic field, which includes five women, and has three Black candidates, a Latino man, an Asian-American man and a gay man. He compared that to his own election as the nation’s first Black president.

“We have a number of women candidates and we have one gay candidate. And those candidates are going to have barriers if they win the nomination, or they win the general election — just like I did,” Obama told donors. “You can overcome that resistance if the way you are framing these issues and messages indicate, ‘Look, I’m part of an American tradition … of opening up opportunity.”

In recent weeks Obama has sought to play both referee and uplifting elder statesman. He’s cautioned “woke” activists against embracing “cancel culture” and urged the party to not adopt positions that could cost them in the general election.

“That’s not bringing about change,” he said during a recent Obama Foundation event. “If all you are doing is casting stones, you’re probably not going to get that far.”

At the same time, he has offered reassurances that a spirited primary will make the eventual nominee a stronger candidate.

It comes amid a fierce intraparty debate that has divided centrists and an ascendant progressive wing, which has advocated for policies like free college tuition and “Medicare for All” that would dramatically reshape the role of government in peoples’ lives.

Elections are ultimately won by offering a message that appeals to voters across the demographic spectrum, Obama said.

“We should not be somehow thinking either we’re going for our base voter of young hipsters and African Americans and single women versus Joe lunch-pail, hard-hat guy,” he said. “Because you know what? … I’ve had conversations with all those groups, and they share common dreams and common hopes and a vision for what a fair, just America would look like.”

The fundraiser Thursday was held at the home of Karla Jurvetson, a prominent Democratic donor and Silicon Valley philanthropist. The event raised more than $3 million for the Democratic National Committee, according to a senior party official.

___

AP National Writer Errin Haines in Atlanta contributed to this report.

___

Catch up on the 2020 election campaign with AP experts on our weekly politics podcast, “Ground Game.”