LORD Advocate Elish Angiolini, Scotland's top law officer, today announced she is to leave the post.
Ms Angiolini, 50, the first woman to hold the role, will stand down after next May's Holyrood election.
At the annual Sexual Offences Conference in Glasgow today, she said it had been an enormous privilege to serve as a prosecutor and law officer for 27 years.
Speaking afterwards, she said: "I can think of no more fitting occasion than this conference to announce that I will stand down from office at the next election, and to thank those who work tirelessly to achieve improvements in the criminal justice system for their dedication and skill.
"This last decade has been a time of great change for the Scottish prosecution system, during which we have worked together with other agencies across disciplines to build a justice system which better serves victims and witnesses, and deals more effectively with serious crime.
"I hope we have formed a strong foundation on which we can continue to build in the months and years ahead.
"I would like to thank all those who work so hard across the Scottish criminal justice system to make this possible."
She was appointed Solicitor General in 2001 by the last Labour/Liberal Democrat administration before going on to become Lord Advocate in 2006. She remained in the post after the new SNP Government came to office in 2007.
Ms Angiolini grew up in Govan, Glasgow, and started her career in the Crown Office and Procurator Fiscal Service. She was the first Procurator Fiscal, and the first solicitor, to become Solicitor General when she was appointed nine years ago.
First Minister Alex Salmond led the tributes to her decade as a law officer.
"It has been a pleasure to work with her since 2007 and her term as Lord Advocate has been marked by significant improvements and substantial success in the disposal of justice in Scotland," Mr Salmond said.
"Among her many achievements are reform of the courts system and a much-needed new approach to tackling sexual crime.
"Under her leadership, recorded crime has dropped to a 32-year low in Scotland and citizens fear crime significantly less than they did when she took office.
"She will be a substantial loss to government after next year but her positive legacy will be long and lasting. I wish her well in her future career."
The Lord Advocate is Scotland's head prosecutor and is also a member of the Scottish Government, often fielding questions in Parliament from MSPs on justice matters.
But when Mr Salmond came to power in 2007, he stopped the Lord Advocate attending weekly cabinet meetings in an effort to depoliticise the post.