RICHMOND, Va. -- Richmond Commonwealth Attorney's Michael Herring announced Friday his plan to resign from office to become a partner at the McGuireWoods law firm in Richmond.

Herring, whose current term as commonwealth's attorney ends in 2021, said he is returning to where his legal career began.

“You have to take a good opportunity when it comes along,” Herring told CBS 6 reporter Melissa Hipolit.

Herring, who has served as a prosecutor for 18 years, said two of his children are in college now and another will be soon attending university.

"With very mixed emotions, and pursuant to VA Code Section 24.2-228.1, I ask that you accept this letter as official notice of my intent to resign from my elected office as Commonwealth's Attorney," his resignation letter read. "I intend to end my status as a constitutional officer and city employee on July 1, 2019."

Herring, who was first elected to the position in 2005, said he was proud of Richmond's "evolution and growth" during his time in office.

"Regarding criminal justice and its reform, I can think of few Executive office holders who have been as committed to equity and fairness in law enforcement and public safety. I encourage you to continue to support the work of the Commonwealth's Attorney's office in its efforts to combat the root causes of crime. This work offers our City its best chance at achieving long-term improvements in public safety," he wrote.

He praised his colleagues who he said worked with "tremendous authority and discretion."

"Our work can be very challenging," he said. "The attorneys and staff with whom I have had the pleasure of working for the past 13 and a half years are all dedicated professionals in service to the City. Like them, I have truly enjoyed my time in the office and consider myself fortunate to have served the citizens of Richmond in such an important capacity."

Mayor praises Herring as 'progressive legal mind'

Richmond Mayor Levar Stoney called Herring an "outstanding Commonwealth’s Attorney" who served Richmonders with "dedication and distinction for 13 years."

"Mike’s keen and progressive legal mind, fairness and commitment to justice, both inside and outside the courtroom, has made Richmond a safer and more equitable place to live," Stoney said.

Stoney praised Herring’s "steady and principled" leadership.

"I join the residents of the City of Richmond in honoring his public service and in wishing him well in the next chapter of his professional life," Stoney said.

This is a developing story.