A former Philadelphia homicide prosecutor who was among the staffers fired when District Attorney Larry Krasner took office will challenge the incumbent in next year’s Democratic primary.

Carlos Vega, who worked in the District Attorney’s Office for 35 years and was the first Latino homicide prosecutor in Pennsylvania, has been a vocal critic of Krasner. He plans to formally announce his candidacy Wednesday.

Vega left the District Attorney’s Office in January 2018, when Krasner fired 31 staffers during his first week. He filed a lawsuit against Krasner last year, alleging that his firing was based on age discrimination. Krasner has denied the firing was related to age, and the lawsuit is still pending in federal court.

Vega said in an interview Friday that his campaign will focus on victims of crime and their families, who have accused Krasner’s office of failing to keep them updated and excluding them from decisions.

“I’ve been contacted by a lot of victims which are homicide survivors, both cases I’ve had in the past and new people,” he said. “It’s total chaos and they’re asking me, ‘Please do something.’ And the only way I can correct this is by being back there and being the district attorney.”

The race is likely to be closely watched, not only in Philadelphia but nationally as Krasner, who first ran as an outsider seeking to change the system, seeks a second term.

Krasner, a longtime defense attorney who was elected in 2017, is running for reelection as prosecutors across the country are at the center of calls to reform the criminal justice system and address systemic racism.

Krasner has overturned wrongful convictions through a Conviction Integrity Unit and has not hesitated to charge police officers with crimes. He has attracted praise from his progressive allies and sharp criticism from opponents, including the city’s police union.

Vega said he doesn’t know whether he would have the support of the Fraternal Order of Police.

“The people who have reached out to me is not the FOP, it’s been mothers whose children have been shot, mothers whose children have been killed,” Vega said.

Brandon Evans, Krasner’s campaign manager, responded to Vega’s entry into the race by defending Krasner’s record of reform.

“DA Krasner was elected on a mandate of reform and accountability,” Evans said Friday. “DA Krasner stands on that record. We’ll continue to pursue that mandate in the campaign and the district attorney looks forward to debating Mr. Vega on the issues.”

Vega said his decision to run is not based in seeking retaliation against Krasner. He had been planning to retire in 2021 if he hadn’t been fired, he said, but he wants to return to the District Attorney’s Office to help crime victims and reduce gun violence by prosecuting illegal gun trafficking.

“I would not be able to live with myself if I say, ‘it’s your problem,’ ” he said.

On a website soliciting donations for his campaign, he says he is seeking to “heal Philadelphia’s division and restore order to the District Attorney’s Office.” Vega calls himself “a committed public servant who used his power at the DA’s Office to protect the city from violent murderers and worked to overturn wrongful convictions.”

The two men have also faced off in the courtroom. In a contentious 2016 triple-murder case, Vega was the prosecutor and Krasner was on the defense team. A jury convicted two men of the murders but was hung on whether to sentence them to the death penalty, resulting in sentences of life in prison.