OAKLAND — Kamala Harris officially launched her presidential campaign Sunday in Oakland in front of a crowd of some 20,000 people — an exuberant display at a scale designed to cement the California senator’s status as one of the most formidable Democrats to enter the presidential race so far.

Harris’s speech swept from Medicare for All to middle-class tax cuts and tuition-free college, frequently invoking her own history as the child of two immigrants and a criminal prosecutor who, she said, spent her life “fighting for the people.”

Unlike the smaller events in Iowa and elsewhere that other candidates have begun their campaigns with this month, Harris’s rally appeared designed for maximum attention. It won it: Her speech was carried live on most major news networks.

In front of a crowd that packed the field marked off for the event space and spilled by the thousands into the streets of Oakland, Harris presented herself as a voice of unity and “moral clarity” for a country that she said was at an “inflection point.”

She also took on President Donald Trump, a man who is known for his habit of watching television — especially Fox News, which carried Harris’s rally. It was a departure from some Democratic presidential candidates, who have shied away from talking about the president.

“Folks, on the subject of transnational gangs, let’s be perfectly clear: The president’s medieval vanity project is not going to stop them,” Harris said to the crowd in Oakland, where she was born.

Some of the biggest cheers of the day came for the line, “We have foreign powers infecting the White House like malware.”

Many in the crowd in Oakland said they had been following Harris’s career for years, first as San Francisco’s district attorney and later California’s attorney general. They saw her as “unbiased,” “fair,” and “qualified,” they said.

“She’s no-nonsense and good on fair law and order,” said Katie Curry, a school administrator in Contra Costa. “I think she’s just, and she’d be diplomatic.”

There was no shortage of reminders Sunday that Harris, if chosen by the Democrats, would be the first black woman nominated for president by a major party.

A black gospel choir sang the national anthem; a young black girl gave the pledge of allegiance; the invocation from a black pastor called for an end to mass incarceration and racism; an African diaspora band played Marvin Gaye. Beyoncé and Alicia Keys recordings blasted through the crowd.

That mattered to many of the people who had come to support Harris, who said that her identity as a black woman and the daughter of immigrants was an “antidote” to Trump.

“I am just so tired of old white men,” said Kathleen Archambeau, a writer in Oakland. “I’m done.”

Many in the crowd said they’d been paying attention to coverage of Harris’s record as a career prosecutor — which critics have said is out of step with progressives on issues like police brutality and the mass incarceration of blacks and Latinos.

“She’s taken a lot of heat in the media right now, and in the black community, because of the fact that she’s a prosecutor,” said Donna Ziegler, a San Francisco attorney and a member of Harris’s black women’s sorority, Alpha Kappa Alpha. “But the fact of the matter is, somebody’s gotta be a prosecutor. And the question is, do you want a prosecutor to be someone who has the lived experience of people of color that can bring that to how she makes her decisions?”

Several protesters outside the rally held signs that reminded people of Harris’s record. Dina Asfaha, a member of a local chapter of the Democratic Socialists of America, walked among rallygoers with a sandwich board sign that lambasted Harris’s record, saying she “supported inmate slave labor” and “imprisoned parents of truants.”

Harris didn’t lean away from her prosecutorial past, spinning it instead as a career spent fighting for victims of sexual violence and going after big banks in the wake of the financial crisis. Early in her speech, she reminded people that as a young district attorney, she had introduced herself with the phrase that has now become her campaign slogan, “Kamala Harris, for the people.”

“As we embark on this campaign, I will tell you this: I am not perfect,” she said. “Lord knows, I am not perfect. But I will always speak with decency and moral clarity and treat all people with dignity and respect. I will lead with integrity. And I will speak the truth.”