A solicitor has been ordered to do 180 hours community service after asking a prostitute to arrange sex for him with a mother and an underage girl.
Ian Donnelly admitted possessing indecent images of girls
Glasgow Sheriff Court heard how Ian Donnelly had sneaked away from his office for the encounter, but the vice girl called police and he was arrested.
Officers later found child pornography on Donnelly's home computer.
Donnelly, 43, who had admitted a number of charges, was also put on the sex offenders' register for three years.
The personal injury solicitor, who worked for Lloyd Green in the city's Cadogan Square, was also placed on probation for three years and ordered to take part in counselling.
The court heard how the incident came just weeks after Donnelly, who is married, sent a letter to an ex-lover asking for a bag of her underwear.
Donnelly, from Stonelaw Road, Rutherglen, initially appeared at Glasgow Sheriff Court last summer where he admitted two breach of the peace charges and possessing indecent images.
However, sentencing was repeatedly delayed due to unavailability of reports.
As Sheriff Alistair Noble decided not to jail him, the civil lawyer will not be automatically struck off.
The court heard that Donnelly had initially met the prostitute in Glasgow city centre on 1 November, 2005, after spending the day in hospital caring for his sick father.
He made "a request" that alarmed her enough to later call police.
However, the woman still arranged to meet him again the next day. She contacted police once more to tell them Donnelly was on his way to her flat.
Fiona Holligan, prosecuting, said that when he arrived he immediately asked if she was "able to get a threesome".
"The woman claimed arrangements were in hand," Ms Holligan said.
"Donnelly said he hoped it would be a young mum in her 20s and that the child had to be under 11."
Police later found Donnelly's DNA in the flat. He was detained at work, but initially denied the allegations.
After searching his home, officers discovered 320 indecent images of girls aged between seven and 15 on his computer.
They also found several X-rated stories involving youngsters.
Ian Duguid QC, defending, said Donnelly had been "living a fantasy" and could not fully explain why he acted in such a way.
"He appreciates his wrongdoing and realises the impact it had on his victims," Mr Duguid said.
Mr Duguid said Donnelly had lost his job, but he did not know how the Law Society of Scotland would respond.
Donnelly would have been automatically struck off had he been jailed for two years or more.