MSPs have approved the appointment of Elish Angiolini as Scotland's first female lord advocate.
Elish Angiolini had served as solicitor general for five years
Ms Angiolini was nominated as Scotland's new senior law officer by First Minister Jack McConnell after Colin Boyd's sudden resignation.
Her nomination was broadly welcomed by MSPs at Holyrood but the Scottish Conservatives raised concerns about judicial independence.
Ms Angiolini is lord advocate-designate pending formal royal appointment.
She was solicitor general for five years prior to her new appointment and was put in temporary charge following Mr Boyd's decision to go on Wednesday.
Scottish National Party Holyrood group leader Nicola Sturgeon welcomed the appointment but questioned the post's dual role.
Tory Leader Annabel Goldie also voiced "real concerns" about the chief legal adviser to the Scottish Cabinet being the country's leading prosecutor.
She said: "There is a real and visible conflict of interest."
Ms Goldie proposed a commission to examine the "proper separation of powers, responsibilities and duties" in relation to the post.
The Scottish Tory leader also questioned whether Ms Angiolini had the "breadth of legal experience" for the job and said she opposed John Beckett QC as the new solicitor general, because he was a Labour member.
Earlier, Ms Angiolini described her nomination as "a great responsibility".
"I am extremely honoured to have been nominated by the first minister for this historic appointment," she said.
"It is both a huge honour and privilege but also a very great responsibility.
"There is still a great deal to be done in the justice system to ensure that, as Nelson Mandela said, prosecutors defend the rights of the weakest and the worst among us."
She said her appointment as the first female solicitor general had been "a huge leap of faith".
"It has been a privilege over the past five years to serve along with Colin Boyd as lord advocate," she said.
"He is a man of great integrity and has been a quiet revolutionary in setting about the way in which the prosecution has gone about its business.
"It has transformed over the past five years but that transformation is something which is a work in progress."
Lord Boyd unexpectedly resigned after six years in the job
Announcing his intention at a press conference in Edinburgh, Mr McConnell praised Ms Angiolini's performance as solicitor general.
"Five years on, I have no doubt whatever that the appointment of Elish Angiolini as solicitor general is one of the best decisions I have made as first minister of Scotland," he said.
"Our prosecution services today are admired, not ridiculed.
"Victims and witnesses see justice implemented in the system, not delays or chaos."
He cited other changes implemented by Ms Angiolini, including improvements in the way rape cases are prosecuted.
"In Scotland's lord advocate I want to have a moderniser, someone who will help with and understand the implementation of our government's policy," he said.
"But also someone who will be honest and consistent in their legal advice to cabinet and to ministers.
"I want someone who will make independent decisions on prosecution with the integrity that the holder of this office has always had."