A learning assistant from Tranent who indecently assaulted a vulnerable schoolboy after making him watch a sex education programme was jailed for four years last Friday.

Andrew Bradshaw, 54, was employed at a school in Edinburgh when he preyed on the 15-year-old, who has learning difficulties.

A judge told Bradshaw at the High Court in Edinburgh: "You have pled guilty to an extremely serious offence in which you engaged in sexual activity with a vulnerable boy." Lord Pentland told him the sex crime involved "some degree of planning and preparation" by Bradshaw when he held a post of "considerable trust".

He pointed out that instead of taking the victim to Dunbar as he had agreed with the child's mother, he went to his [Bradshaw's] home.

Lord Pentland said: "You made him watch a sex education TV programme you had previously recorded." The judge said Bradshaw would have faced a six-year sentence but for his guilty plea.

Lord Pentland told Bradshaw he would be on the sex offenders' register for life and would recommend he be included on a list of those unsuitable to work with children.

The judge earlier heard the sex offender had taken an overdose of aspirin and ended up in hospital because he was "racked with guilt" before a previous scheduled court appearance.

Bradshaw had admitted illegally engaging in sexual activity with the child at his home at Morrison Avenue, Tranent, on July 29.

Advocate depute Alison Di Rollo told the court that the first offender had been employed as a learning assistant for 15 years.

Bradshaw had gone to the boy's home on the day of the crime as he was to help him travel to see a friend. He suggested to the boy's mother he take him for a walk instead, but she insisted he should go on the visit.

But after leaving, the learning assistant and the youngster got on a bus and went to Dalkeith before walking six miles to Bradshaw's house in Tranent.

Ms Di Rollo said: "Once within the address, the accused prepared the boy lunch before making him view a Channel 4 sex education programme." As they were watching it, Bradshaw exposed himself. The learning assistant then pulled down the boy's trousers and pants and began performing sex acts.

The advocate depute said: "The victim was terrified and was too scared to pull away." After it the boy made an excuse to leave the room to go to the toilet. When he returned, Bradshaw told him he would take him back home but made it clear he should not tell his mother what had happened.

The youngster did not reveal the abuse to her until the following day.

His mother immediately contacted the police.

Officers later went to Bradshaw's home where he was detained. During an interview, he confirmed he was aware of the schoolboy's learning difficulties. He admitted he had taken the boy to his home against his mother's wishes.

Ms Di Rollo said: "He conceded that while within the house he instigated sexual talk with the victim and agreed he had shown a programme about sexual development.

He admitted carrying out a sexual assault on the victim." She said Bradshaw conceded that his actions were wrong and were "in no way an accident".

Defence solicitor advocate David Allan said: "He regrets his behaviour. He understands a custodial sentence is inevitable because of the nature of the offence." "He has asked me, for what it is worth, in open court to apologise to the victim and the victim's family for his behaviour."