A woman teacher who spent the night in her student’s bed  wearing only her jeans and bra has narrowly avoided a prison sentence.

The teacher, Bernadette Smith, was said to be infatuated with Gary Ralston, who was 16 at the time. That obsession cost the married 35-year-old her job and reputation, a court heard.

Gary, who waived his anonymity to speak of their relationship, said Smith had been his favourite teacher before she targeted him for particular attention.

 He said: ‘I was thinking I was quite lucky. A lot of the boys fancied her. I couldn’t believe she was with me. It was the last thing I expected. She said she thought she was going crazy but couldn’t help the way she was feeling.’

Gary revealed how his relationship with Smith, who was his teacher during third, fourth and fifth year, began during secret meetings at school.

‘When I started year six, Bernadette was no longer my teacher, but we’d pass each other in the corridor, say hello and smile,’ he said. He said that Smith later summoned him to her classroom.

‘I walked in and as soon as I sat down she said, “Ever since we’ve been back at school and I’ve seen you around, I’ve been realising I have feelings for you”,’ he said.

Describing himself as ‘curious’ and ‘excited’, Gary agreed to meet the history and English teacher on September 13 last year.

Gary said he worried for Smith’s job, husband and family but said she ‘didn’t seem too bothered’.

He confided in his father, who warned him to be careful but his grandmother called Bannockburn High School to complain. Smith was suspended immediately.

Despite their relationship being made public, they stayed together the next night at Gary’s home in Cowie.

Gary said: ‘We got ready for bed and I felt nervous. I got into bed with my boxers on. She took off her top, but kept her bra and jeans on, and slid in beside me.

‘We cuddled and talked – nothing else happened.’

His father Richard Ralston, 42, said: ‘I wasn’t pleased about what happened, but you’re an adult at 16 in Scotland so I didn’t want to interfere too much.

‘I want Gary to make decisions and learn from any mistakes.’

Prosecutor Ann Orr told Stirling Sheriff Court that when interviewed, Smith said ‘she loved the boy and they both wanted to be together’. She admitted kissing Gary and staying the night in his bedroom.

There was no suggestion that Gary had suffered any long-term harm, the court was told.

Smith, of Denny, Stirlingshire, pleaded guilty to engaging in sexual activity with a pupil while in a position of trust, between September 13 and 20 last year.

She was placed under supervision for two years and will remain on the sex offenders’ register for the same period.