The offending took place over a 12 year period, August 2010 and October 2022.
He pleaded guilty to an amended indictment, with the total sum being £400,310.65.
The sum was amended down from more than £459,000.
He arrived at the High Court on Monday wearing a black suit with a black tie and appeared alongside his lawyer John Scullion KC.
Judge Young said it was a significant “breach of trust” by Murrell in his position as chief executive.
He told Murrell: “You have pleaded guilty to a charge of embezzlement over a period of 12 years.
“You embezzled just over £400,000 from the Scottish National Party.
“As the chief executive officer of that organisation throughout that period your actions constitute a gross breach of trust.”
He was remanded in custody and will be sentenced on June 23.
Murrell was chief executive of the party for 22 years. He and Ms Sturgeon had been one of the most powerful couples in UK politics over many years.
In January last year, Ms Sturgeon announced she and Murrell had “decided to end” their marriage.
Murrell, 61, has admitted using the SNP’s money to buy items including a motorhome and luxury goods, and towards the purchase of two cars.
The indictment included allegations that in 2020 Murrell used party funds to buy a £124,550 motorhome for his own personal use.
Murrell’s conviction is the result of a police investigation called Operation Branchform, which was first launched in 2021.
The policing cost of the long-running investigation reached more than £2 million.
In a scathing statement, Assistant Chief Constable Stuart Houston, who had oversight of Operation Branchform, said: “This was a lengthy and extremely complex case due to the scale of criminality over a 12-year period and the lengths Peter Murrell went to try and cover his tracks.
“I commend the professionalism and absolute dedication of the Operation Branchform team who spent more than four years carrying out extensive enquiries across Europe to unpick Murrell’s offending.
“All of this work, in close partnership with colleagues from the Crown Office and Procurator Fiscal Service, was carried out under the most intense public scrutiny and it was their commitment to gathering such detailed and compelling evidence that brought us to the High Court today.
“This is without doubt one of the most high-profile investigations in recent times and it is testimony to the work of Police Scotland officers and staff that has led to Peter Murrell’s admission of guilt early in the court process.
“I would also like to thank the many witnesses who came forward to provide us with statements as we built the case against Peter Murrell. Their engagement with us was vital.
“Peter Murrell has shown utter contempt for the high public trust placed in him as the Chief Executive of a political party and his position in the wider political establishment in Scotland for many years.
“He abused his privileged position with access to Scottish National Party funds to divert cash into his own accounts and bankroll the lavish lifestyle he craved but could not afford.
“From 2010 to 2022 he spent hundreds of thousands of pounds on luxury goods while carefully trying to hide his criminality with false receipts and accounting.
“He must now face the consequences of his actions.”
