An internet gambler who lost more than £150,000 on his parents' credit cards has avoided a prison sentence.
Mahan admitted having a gambling problem
Richard Mahan, who earlier admitted fraud, has been ordered to carry out 300 hours of community service and was placed on probation for three years.
At Forfar Sheriff Court, the 25-year-old from Aberdeen was told he was being spared a prison sentence to address his gambling addiction.
It is thought to be Scotland's worst case of internet gambling.
Mahan blew the money on a William Hill online betting site, only stopping when he reached the credit limit on his mother and father's 13 cards.
He then tried to kill himself.
Sheriff Kevin Veal told Mahan he was not imposing a custodial sentence in order for him to "properly address" his gambling addiction.
"It is preferable that (Mahan) be made to address his gambling addiction than to be placed in a prison cell where there is not an iota of support for his particular problem," he said.
Mahan earlier admitted 13 charges of fraudulently running up debts of £68,000 on 2 and 3 April, 2005.
The father-of-one used the computer at his then family home in Brechin, Angus, to access the sites while his parents were away.
Using the credit cards he created 13 accounts by typing in the numbers which he had got from his parents' bank statements.
He won £90,000 in the first hour but continued to bet and started losing money.
In a desperate attempt to recover Mahan kept gambling, not only losing his winnings, but ending up £68,000 in debt.
When he realised the extent of his gambling he took about 170 painkillers and cut his wrists.
He also wrote a suicide letter to his family in which he said: "I am really sorry, I gambled again but this time worse than ever.
"I think I have stolen around £80,000 from your credit cards and emptied your bank accounts."
His father was told by the credit card companies that in order for their insurance cover to kick in, the matter would have to be reported to the police.
Mahan's parents had earlier taken out a £17,500 loan and borrowed a further £15,000 to try to help him with his gambling debts.
His defence agent John Clancy said online companies tried to entice people by offering them substantial gifts, such as money.
He said of his client: "He admits he has a gambling addiction, there is no doubt about that."