Letitia James became the first black woman to win a major party statewide nomination on Thursday, easily defeating three rivals in New York’s Democratic primary for attorney general.
With her win, Ms. James, 59, the New York City public advocate, has positioned herself as a prominent face of resistance to the policies of President Trump, a role that the New York attorney general’s office has embraced since Mr. Trump took office.
“This campaign was never really about me or any of the candidates who ran,” Ms. James said in her victory speech. “It was about the people, but mostly it was about that man in the White House who can’t go a day without threatening our fundamental rights.”
With Democrats outnumbering Republicans in New York State by a margin of more than two to one, Ms. James will be heavily favored in November against the Republican candidate, Keith Wofford, 49, who ran unopposed. If Ms. James wins, she would be the first black woman to assume statewide office, just five years after becoming the first black woman elected to citywide office in New York.
Ms. James beat out three other candidates who would also have made history if they had been elected as attorney general: Representative Sean Patrick Maloney, who was seeking to be the first openly gay holder of statewide office; and two women who would have been the first to be elected to the position: Leecia Eve, an African-American former top aide to Hillary Clinton; and Zephyr Teachout, a law professor.
“Tish James is going to be the strong, progressive attorney general we need to stand up to Donald Trump,” said Bill Lipton, the state director of the Working Families Party.
Ms. James said she had received concession calls from Mr. Maloney and Ms. Teachout and that Ms. Eve had tried to reach her. Mr. Maloney, speaking at a Spanish restaurant in the Manhattan neighborhood of Chelsea, was conciliatory.
“We have so much more in common than divided us in this primary,” he said.
James supporters gathered at Milk River, a bar in Crown Heights, Brooklyn. As early returns appeared on a large screen, showing Ms. James with a lead, the crowd broke into cheers.
“She brings a lot of hope to black and brown people,” said James E. Caldwell, 67, a community leader in Crown Heights.
Ms. James became the front-runner to be appointed to replace Mr. Schneiderman. As an attorney who had run the attorney general’s Brooklyn office and who used the public advocate’s office to file multiple lawsuits against the city, Ms. James was seen by some as an ideal candidate.
With 97 percent of precincts reporting, Ms. James had 40 percent of the vote, followed by Ms. Teachout with 31 percent and Mr. Maloney with 25 percent.
Ms. James pledged to be the “independent individual I have been” in her victory speech.
“Nothing’s going to change about Tish,” she said. “I’m still just a girl from Brooklyn.”