LOS ANGELES — Sen. Bernie Sanders’s remarks to a mostly Muslim audience in Los Angeles were a last-minute addition to his schedule last weekend. As he stepped onto the stage he warned 200 people in the audience that he was about to do something very un-Bernie-Sanders-like.

“I don’t like talking about myself,” Sanders (I-Vt.) confessed Saturday. “I prefer to talk about ideas and vision.”

Then, for more than six minutes, Sanders shared more personal details about himself than he’d revealed during three weeks of policy-heavy speeches in Iowa and South Carolina.

He spoke of growing up a son of poor immigrants in a rent-controlled Brooklyn apartment. He told the crowd about his mother who “died young of a heart condition” and never realized the American Dream of owning the home her family lived in. He spoke of reading books about the Holocaust with tears running down his face.

Then, raising his voice, he expressed outrage at the latest example of animus centered on race and religion and ethnicity that left 50 Muslims dead in a mosque in Christchurch, New Zealand, this month.

“After all of that suffering. After all of a horrible 20th century which has seen a number of genocides, one might have hoped and believed that maybe, just maybe, the world would understand that we share a humanity,” he told the crowd. “Who really stays up at night worried that your skin is darker than mine? Who worries that your religion is different than mine?”

The off-the-cuff, emotion-laden remarks earned Sanders a standing ovation and became the latest sign of what Sanders’s camp has said is the difference between this bid for the presidency and his last one. This time, they say, he is putting a renewed focus on showing people the person behind the policy positions.

But even still, he dropped the personal remarks at other California events, suggesting Sanders remains uncertain about how much of his personal story to consistently inject into his campaign.

Sanders’s California swing demonstrated some of the strengths of his campaign; he spoke to 12,000 at a Los Angeles park on Saturday and to 16,000 in San Francisco a day later. Many who attended said they have been Sanders supporters for years and feel vindicated that other candidates have adopted policy positions the senator from Vermont trumpeted in 2016.

But despite the outpouring of support for Sanders, there are challenges across the electoral map and in California. Sanders lost California’s primary to Hillary Clinton 53 percent to 46 percent, and the state is the home turf of one of his primary opponents, Sen. Kamala D. Harris, who drew more than 20,000 people to her campaign kickoff rally in Oakland in January.

Harris is one of a diverse group of candidates who have woven gripping personal stories into their stump speeches, in her case recounting her childhood attendance at civil rights events and her bicultural heritage. Former San Antonio Mayor Julián Castro talks about being the grandson of a Mexican immigrant with an elementary school education. Sen. Cory Booker of New Jersey, who is black, speaks of his family’s fight to move into a white neighborhood. Former Colorado governor John Hickenlooper frequently tells voters about how he rebounded after being laid off.

Sanders touched on his ­upbringing in introductory ­speeches in Chicago and Brooklyn. But his subsequent trips to early primary states have reverted, as some of his California events did, to classic Sanders: hour-long discourses on policy positions to a crowd that skews mostly young and mostly white.

Experts and Sanders campaign officials say Sanders’s attempt to retool his tone at times is aimed at people who are still unsure about whether to vote for him.

Jason McDaniel, a political science professor at San Francisco State University, said Sanders’s increasing talk about himself is evidence that he is, perhaps begrudgingly, listening to the more diverse team he’s surround himself with in this campaign.

“In 2016, it became sort of a protest candidacy,” McDaniel said. “Now I think he’s in it to win. I think he sees a pathway. And if it’s really possible for you to win, then you start thinking about every vote. I guess the positive thing would be that he’s listening to some of the criticism.

Tahir Farukhi, a 33-year-old lawyer from Newport Beach, Calif., who says he’s leaning toward voting for Sanders, said he has always been attracted to the senator’s economic message. But he said he was touched that Sanders expressed solidarity with mourning Muslims in Los Angeles, and that more people in his community could relate to Sanders’s words. Like Sanders’s father, Farukhi’s parents came to the United States as immigrants with big dreams and little money, a link the attorney found relatable.

“He’s not someone who’s trying to be smooth or something like that. He’s even a little scruffy,” Farukhi said.

“He was talking more about what Americans are facing day-to-day,” Farukhi said. “He was here to not just talk about global theoretical things, but also about the people in front of him.”

Sanders’s admitted unwillingness to get consistently personal has frustrated some of his closest supporters, who have said talking about his lower-middle-class background, painful family connections to the Holocaust and years spent fighting in the civil rights movement would connect him with a wider swath of voters. (Sanders’s campaign would not publicly discuss his strategy.)

Prominent Black Lives Matter activist Shaun King, a Sanders supporter, told The Washington Post that he implored the senator this year to talk about how he spent the 1960s “chaining himself to black mothers” to protest racist education policies.

As he did in 2016, Sanders has struggled to attract African Americans and other nonwhite voters to his rallies. The results have been noticeable in South Carolina, an early-voting state where nearly two-thirds of Democratic primary voters are black. The crowds in California were largely white.

Still, some of his supporters said they found his straight talk endearing. They said his unwillingness to snap dozens of selfies and engage in more traditional campaign niceties paints him as a sort of anti-politician who appeals to their heads, not simply their emotions.

“He just seems like the most sincere,” said Cody Machato, who rode his bike to Sanders’s rally in San Diego on Friday. “He definitely comes across as far more authentic and genuine. And he’s definitely the most outspoken.”