WEST COLUMBIA, S.C. — Senator Kamala Harris of California has, for months, faced criticism from activist Democrats who have said her record as California attorney general was at odds with her progressive reputation.
But on Saturday, as Ms. Harris seeks to reinvigorate her presidential campaign, she went on the offensive, laying out a robust defense of her record as prosecutor and decrying what she called “self-appointed political commentators” who fail to understand the complexities of criminal justice.
“There have been those who have questioned my motivations, my beliefs and what I’ve done,” Ms. Harris said in a speech in South Carolina. “But my mother used to say, ‘Don’t let people tell you who you are. You tell them who you are.’ So that’s what I’m going to do.”
In the speech, Ms. Harris cast herself as a change agent from within the system.
“It matters who is in those rooms,” she said. “I demanded we reject the false choice that said you’re either tough on crime or soft on crime. Instead, I said we must be smart on crime.”
Ms. Harris burst onto the presidential stage with an announcement before a crowd of 20,000 in her hometown, Oakland, Calif., an early show of force in a race that began without a clear front-runner. She has fallen in recent polls, however, which has triggered concern within her campaign and among her supporters.
But those close to Ms. Harris say they are confident she is finding her stride. On Sunday, at a dinner for Iowa Democrats that several presidential candidates will attend, Ms. Harris will revive her focus on President Trump, according to an aide, and argue that she is uniquely positioned to “prosecute the case” against him. Her speech Saturday got several ovations among the older black crowd that gathered for the annual N.A.A.C.P. Freedom Fund dinner.
Ms. Harris was the first black woman to serve as California attorney general and the second black woman to serve in the United States Senate. The speech made a vigorous case for the power of racial representation, and she frequently used “we” to refer to the black community. Ms. Harris argued that because of her identity, background and experiences, her mere presence in the state’s law enforcement systems helped make them more just and equitable.
Government needs “people who bring the context, awareness and life experience to the job, to make the system more just,” she said.
In addition to a more direct defense of her prosecutorial record, Ms. Harris has talked more explicitly about Mr. Trump in recent months. As the campaign has edged along, she has more explicitly rejected the language of “structural change” that defines the more leftist candidates and increasingly cast herself as a policy pragmatist in the tradition of Democrats like Barack Obama and Hillary Clinton.
Helen Rosamond-Saunders, a 73-year-old retired teacher, said Ms. Harris’s identity as a black woman gave her a special connection with black voters in South Carolina.
“It gives us, as black women, a special opportunity to support someone with the same goals and experiences that we have,” she said. “Now we need to step up to the plate.”
Katie Davis-Hill, 67, said she liked when Ms. Harris talked directly about Mr. Trump.
“She’s awe-inspiring,” Ms. Davis-Hill said. “We now have someone who thinks he’s above the law, but with her as a prosecutor, she knows what someone who isn’t telling the truth looks like.”
In Democratic events this presidential cycle, even at those for other candidates, Ms. Harris is typically mentioned as a candidate who generates significant interest. She has repeatedly drawn sky-high television ratings for cable news town halls.
But she has also been accused of relying too much on her identity and biography, particularly in a race in which all Democratic candidates, including white ones, are talking more specifically about race.
Her campaign recently announced a major summer investment in Iowa staff, after Democrats there openly wondered if Ms. Harris had done enough grass-roots organizing to succeed in the state. New Hampshire Democrats have also questioned whether Ms. Harris has visited the state enough.
In South Carolina, where Ms. Harris has appeared at more campaign events than any other Democratic candidate has, she received a rousing ovation whenever she assailed the president.
The voters she was courting are also being wooed by former Vice President Joseph R. Biden Jr., the Democratic front-runner at this early stage. Part of her goal was to show she can best argue the case against Mr. Trump.
“We’ve got to hold this guy accountable by prosecuting the case in front of the American people against four more years of this administration,” Ms. Harris said to applause. “I’ve prosecuted a lot of cases. But rarely one with this much evidence.”