A SENIOR IT manager stole £500,000 from the National Library of Scotland (NLS) in a "sophisticated and complex" swindle lasting four years.
David Dinham, 33, who had control over the historic institution's huge budgets, is facing prison after library staff spotted financial irregularities and called in the police.
The NLS, on George IV Bridge, in Edinburgh's Old Town, said its financial systems had since been tightened up.
It has now clawed back 150,000 from Dinham and is taking legal action to try to recover the remaining 350,000.
Dinham admitted the embezzlement charge at a hearing at Edinburgh Sheriff Court last week.
He is due to be sentenced next month once reports into his mental state, ordered by a sheriff, are compiled.
Precise details of how Dinham stole the cash have yet to emerge.
But the offence took place between 6 September, 2006, and 9 June, 2010, according to court papers.
During that time, he was in charge of a 1.8 million project to store the library's digital archive.
In November 2007, he was involved in employing consultancy firm GlassHouse Technologies to help NLS make its entire collection available across the internet.
The following December, the contract to create the archive was handed to the firms Viglen and Hitachi Data Systems.
Dinham spoke highly of the archive system, saying in an interview: "I know that our cultural heritage is being backed up securely, too - and that helps me sleep at night."
He is also listed in company records as having been the director of his own Scottish computer firm, the Coatbridge-based Raith Solutions, since November 2008.
Martyn Wade, national librarian and chief executive of the NLS, said: "This was a complex and sophisticated crime committed by a senior manager and budget holder who had a detailed knowledge of internal processes and procedures.
"Our systems identified discrepancies and as soon as these were confirmed, appropriate action was taken and the police were notified.
"Internal procedures were immediately reviewed and strengthened.
"A planned upgrade to a new financial system has recently been completed, which should prevent any future misappropriation of this kind."
He added: "To date, over 146,000 of stolen funds has been recovered and the National Library of Scotland is continuing legal proceedings to recover as many funds as possible."
Mr Wade said it was inappropriate to comment further on the case while legal proceedings continued.
It is not known whether Dinham was sacked from his post or resigned, but he no longer works for the NLS.
Founded in 1689 as the Library of the Faculty of Advocates, the NLS holds almost 400 years' worth of Scotland's written history and culture.As the legal deposit library for Scotland, it is entitled to claim a copy of every publication released in the UK, amounting to more than 6,000 items a week.
According to online employment records Dinham has held a number of high-ranking posts at major institutions.
He was educated at the Australian National University and at the Open University and studied psychology.
At last Tuesday's court hearing, Sheriff Michael O'Grady QC asked for psychiatric reports.
Dinham, who was listed as living at an address in Edinburgh, is due to appear back in court on 21 June.