New York City Public Advocate Tish James has emerged from a crowded field to win the Democratic primary for state attorney general, CNN projects, putting her on a path to taking over one of the country’s most powerful law enforcement offices.

If she wins in November, James will become the first black woman elected win statewide office in New York. The former city council member was endorsed by Gov. Andrew Cuomo, and reaped the benefits of the backing of the state Democratic establishment, but is also likely to appear on the progressive Working Families Party ballot line this fall.

A former public defender and city council member, James outlasted anti-corruption activist and scholar Zephyr Teachout, Rep. Sean Patrick Maloney and Leecia Eve, a Verizon lobbyist.

She will face Republican Keith Wofford, a Buffalo native, in a general election contest to replace Barbara Underwood, who was appointed to the job by the state legislature following the resignation of Eric Schneiderman, who departed in May after four women accused him of assault in an explosive report in The New Yorker.

In the Democratic debates, James was critical of the Trump administration, saying that the President has “trampled on the rights of countless individuals throughout the state of New York” while pledging to “challenge the forces-that-be and stand up for marginalize communities” targeted by White House policies.

The New York state attorney general’s office has often been used as a launching pad for ambitious officials. Both of Schneiderman’s predecessors, Eliot Spitzer and Cuomo, won the governorship after running the office. If she wins it in November, James will immediately be thrust into the national spotlight because of Trump’s business ties in New York and the potential to further challenge his administration in court.

James has called the President an “embarrassment to all that we stand for” and suggested in web video that “he should be charged with obstructing justice,” saying she planned to “follow the money because we believe that he is engage in a pattern and practice of money laundering.”

She entered the final days of the campaign in what seemed like a dead heat with Teachout, who was the progressive grassroots favorite, and Maloney, who was stronger with voters outside the city. But she overtook them with a boost from Cuomo’s financial might — his barrage of television commercials touted “Cuomo, Hochul and James” — and the split loyalties of the Working Families Party, which didn’t attack her and instead dedicated its resources hammering Maloney over his support for recent legislation to roll back bank regulations and past votes against a number of Obamacare-related bills.

"There are two incredible progressive women in this race," WFP state director Bill Lipton said of James and Teachout back in May. "New Yorkers would be lucky to have either as our next Attorney General."