Scotland's top prosecutor is resigning from his job, it has been announced.
Lord Boyd has been involved in many high profile cases
The Lord Advocate Lord Boyd has written to First Minister Jack McConnell to inform him of his plans.
A statement from the first minister's spokesman confirmed Lord Boyd of Duncansby QC would stand down from his post at midnight on Wednesday.
He will spend time in the House of Lords and seek private sector work. Lord Boyd denied he was leaving because of the Shirley McKie fingerprint probe.
Lord Boyd was head of the prosecution service for almost 10 years and was also the Scottish Executive's senior legal adviser.
In his letter to Mr McConnell, he said: "I have been in government since May 1997 and am now the longest serving Lord Advocate for over 100 years.
"It is time for me to move on."
Lord Boyd's work has involved the prosecution in the Lockerbie bombing trial and he has been caught up in the controversy surrounding the McKie fingerprint case.
The executive stressed that his decision to stand down was not related to the McKie investigation.
The first minister expressed his disappointment in his reply to the lord advocate.
He added: "You leave a legacy of which you should be unashamedly proud.
"The Lockerbie trial raised the profile and credibility of the prosecution service in Scotland and your leadership of the Crown Office has been first class."
The Scottish National Party welcomed his departure and said he had been under a cloud over the McKie case.
Nationalist MSP Alex Neill told BBC Scotland's Holyrood Live programme: "I believe that Lord Boyd has recognised his failings in this case and that's the real reason he's going at this moment."
Conservative MSP Margaret Mitchell said the sudden departure was strange and unexpected.
Shirley McKie's case is being examined by MSPs
Ms Mitchell said: "I would have thought the sensible thing to do would be to see through the Legal Profession and Legal Aid Bill and to await the outcome of the justice 1 committee report into the Shirley McKie case and into the investigation of the SCRO (Scottish Criminal Record Office).
"For him to go before that seems an astounding decision."
Speaking to BBC Scotland, Lord Boyd insisted it was simply the right time for him to move on and that his decision was not prompted by the McKie probe or the possibility of a Lockerbie retrial.
He said: "As I said, I've been in office now for nine-and-a-half years, I think that's long enough for anybody.
"I became a life peer earlier this year, I want to take up the full opportunity of working in the House of Lords and also pursue opportunities in the private sector."
But Ms McKie's father, Iain, called for a full explanation to be given.
He said: "Speculation will happen, spin happens of course, we need to know why did he leave, the exact reasons why he left and then we can settle back.
"I think at the moment it's certainly unclear, but I do believe my daughter's case would have something to do with it."
Lord Boyd began as a solicitor in private practice before being called to the Scottish Bar in 1983.
He worked as an advocate depute from 1993 to 1995 and took Silk in 1995.
He was then solicitor general for Scotland from May 1997 until his appointment as the lord advocate.
In April 2006 he was appointed to the House of Lords, taking his title from Duncansby Head in Caithness.
His duties will be taken up by the current Solicitor General, Elish Angiolini QC.
The first minister is expected to reveal details of plans for selecting a replacement. It is up to Mr McConnell to nominate a candidate for the post.