He said he does not make decisions with his legacy in mind. He has won praise for modernizing the office’s use of data to target violent criminals, spending millions to clear a backlog of rape kits, setting up a special domestic violence unit and routinely prosecuting sex traffickers.

“Ultimately, my legacy, such as it is, is to leave this office to be an office capable of handling all the variety of crimes that we have in the 21st century and to be modern about the way we investigate cases,” he said.

Before the #MeToo movement, Mr. Vance’s office had a reputation for being conservative in sex-crimes prosecutions.

His decision to bring the case against Mr. Weinstein was a gamble, several criminal lawyers said, because the two main accusers — Miriam Haley and Jessica Mann — had consensual sex with Mr. Weinstein after the attacks. Many prosecutors would not have taken the chance, fearing that the women’s credibility would have been shredded on cross-examination.

Mr. Vance said he decided to press ahead despite the complex relationships the two women had with Mr. Weinstein.

“We felt that what we had was raw, open and honest, and they were credible and believable even if they weren’t the typical witness that a courtroom expects to see,” he said.

When he made the decision in May 2018, Mr. Vance was under intense public pressure.

He had been hammered for declining to bring charges in 2015 when a Filipina-Italian model accused Mr. Weinstein of groping her breasts and shoving his hand up her skirt during a meeting at his office in TriBeCa. The governor had asked the attorney general to review that decision, and feminists from organizations like the National Organization for Women protested, demanding he take action against Mr. Weinstein.