Michael Matheson has quit as health secretary in the aftermath of the controversial iPad roaming bill scandal.
The senior SNP minister stepped down from his post following repeated demands for his resignation.
In a letter to the first minister, Mr Matheson said he was resigning to stop the fiasco from becoming too much of a distraction from his job.
He will be replaced by energy and economy secretary Neil Gray, a close ally of First Minister Humza Yousaf.
Mr Matheson’s resignation comes ahead of the publication of what is expected to be a damning report into the scandal which erupted last November.
He had billed the taxpayer for an £11,000 roaming charge on his iPad during a family trip to Morocco after Christmas in 2022.
He insisted several times the device had only been used for parliamentary business, despite the huge sum of money.
But in a U-turn, the health secretary later blamed his teenage sons watching football for the five-figure bill.
Mr Matheson maintained he had only become aware his children had been responsible for the huge charge after the controversy escalated.
He reimbursed the Scottish Parliament in full, and admitted he “should have pressed harder” to find out why the massive bill had been incurred.
Yet the outgoing health secretary clung onto his post at the time and was strongly backed by Mr Yousaf.
It’s understood he will be entitled to a one-off severance payment of £12,712, more than the bill incurred on his iPad.
His decision to grant the inquiry into the scandal surrounding the doctor came after years of relentless demands from campaigners.
But victims of the rogue neurosurgeon have since become frustrated over a lack of progress and uncertainty over Jason Leitch’s involvement in the process.
In his letter today, Mr Matheson said: “It is in the best interest of myself and the government for me to now step down to ensure this does not become a distraction.”
The departing health chief thanked Mr Yousaf for his support during his embattled time in the role.
Veteran Falkirk MSP Mr Matheson is one of the SNP’s most experienced government ministers.
He has spent nearly 13 years continually on the party’s frontbench, serving as justice chief and energy secretary before taking on the transport brief.
Mr Yousaf said he was sad to see Mr Matheson resigning but understood why he had made the decision to go.
The first minister said: “It is with sadness that I accept your resignation.
“It is right that, having requested that the Scottish Parliament Corporate Body review your data roaming charges from last year, that you fully engage with that process as it comes to its conclusion.
“I agree that it is therefore best for you to now step down to ensure you are able to give the parliamentary process the attention it deserves without it becoming a distraction to taking forward the government’s agenda.”