Letitia James, New York City’s public advocate, won the Democratic primary for New York State attorney general, and could become the first African-American woman to hold statewide office in New York.

James defeated US Rep. Sean Maloney, attorney Zephyr Teachout, and Leecia Eve, a Verizon executive with past government experience.

James won the backing of the state Democratic Party and Gov. Andrew Cuomo’s endorsement, which gave her a boost of name recognition and clout outside of New York City, where she’s served as the public advocate since 2014 and previously served as a City Council member.

James had jumped out as the frontrunner for the attorney general job soon after Eric Schneiderman resigned amid assault allegations. But as insurgent progressive campaigns started to get attention in New York and elsewhere, James’s Democratic Party backing turned her into the establishment figure in the race. She bristled at the label; as she told New York magazine, “In May, I was the progressive darling, and now I am the Establishment.”

Whether voters decided she is the progressive darling again — or they didn’t mind her establishment ties — James overcame any questions to secure the Democratic nomination on Thursday.

Like her three defeated primary opponents, James vowed she would take on corruption in Albany, the state capital — and Donald Trump.

The state Attorney General’s Office sued Trump University under the leadership of Schneiderman, and his temporary successor, Barbara Underwood, brought a lawsuit against Trump’s family charity. The office is reportedly investigating Michael Cohen’s taxes, too. All that doesn’t include, as of August, about 150 legal actions against the Trump administration.

James will face GOP candidate Keith Wofford in November, an attorney originally from Buffalo, New York, who is the first African-American Republican candidate for attorney general. Wofford has also vowed to clean up corruption in Albany, and he’s pointed out the many Democratic attorney generals who’ve failed to do so in years past. Wofford has been cagey so far about investigating Trump; he’s said he’ll focus on bringing suits that benefit the interests of New York, not on trying to score political points.

James and Wofford will have made history with their campaigns no matter what. It’s just up to New York voters who they want to be fighting corruption in Albany — and Washington.