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.

[New York Attorney General Letitia James sues the NRA.]

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.