A teacher accused of having sex with a 14-year-old pupil joked he was seeing ‘an illegal bird’, a court heard yesterday.

Ryan Fisher, 29, told a pal he couldn’t reveal who the female was but he denied she was ‘underage or a pupil’ because he ‘valued his career.’

But giving evidence in his own defense, Fisher told Ayr Sheriff Court the 'illegal bird' was a prostitute he slept with on his birthday.

The girl, now 20, alleges the ex-academy teacher, from Troon, had sex with her for two years and told her he was 'like a Jimmy Savile.'

She angrily denied lying about the encounters in a tearful exchange and said she wouldn’t put herself through the trial if it wasn’t true.

The friend was read Facebook messages between himself and Fisher written in June 2015 by procurator fiscal depute Hayley Robertson.

The witness agreed they were discussing a sexual relationship Fisher was having.

Fisher wrote: ‘I can never tell anyone not even you.’

The witness asked: ‘Someone I know?’

Fisher replied ‘No.

‘An illegal bird hahaha.’

His pal asked: ‘underage??? A pupil???’

Fisher replied: ‘NO!!! Holy f**k. I value my career more than that.’

Fisher left the dock for the witness box to defend himself against the claims.

He told his counsel Mark Moir he had done a post-grad degree in teaching and was also a special constable with Police Scotland while the alleged sexual relations were happening.

Asked about the 'illegal bird' comment, he said he had slept with a woman on his 21st or 22nd birthday, at least three years prior to the facebook conversation, who later asked him for cash.

He said: "I didn't realise she was a prostitute until she asked me for money.

"As far as I know, prostitution is illegal."

He said he had met the schoolgirl 'five or six' times in his car, including in the early hours of the morning, but denied that there had been any sexual contact.

He admitted swapping around 1,000 messages with the girl through various social media including a comment that he 'was like a Jimmy Savile.'

He also admitted sending messages about her taking the contraceptive pill before meeting him.

He said: "I've lost my career and I've lost my life.

"I made some silly comments but I would never contemplate having sex with a student.

"I would immediately lose my job.

"I was naive - I know it wasn't wise to be communicating with her.

"I realise how strange it looks now (to meet her in his car) but I'm paying for it."

Earlier, under cross examination by defense counsel Mark Moir, the complainer denied making up the claims against Fisher.

She had told the court the pair had sex up to 20 times in his motor, twice in his home and once in a forest.

Mr Moir said: “I’m suggesting none of that happened.

“All that ever happened in that car was you went for drives, chatted on occasion. At no time did he commit any sexual act.”

She replied: “That’s a lie.”

Mr Moir said: “When you spoke to your mum, you, for whatever reason, began to make false allegations and it spiraled out of control.”

Breaking down in the witness box, the woman said: “That is a complete lie.

“I wouldn’t put myself through this.

“It has affected my life for years.”

The girl’s mum told how she discovered messages between the pair in January 2016.

She said: “My daughter had been acting very secretive for a while.

“There were messages from Ryan along the lines of ‘I think we should have a reunion’, ‘I miss you’ and ‘is it ever going to happen again.’

“I felt sick.

“My daughter got so upset, she got herself into a ball.

“She told me they had been having a sexual relationship.”

Fisher denies having sex with the girl between December 2013 and February 2015.

A charge of sending a sexually explicit message via Skype was withdrawn by the Crown.

The trial before Sheriff Desmond Leslie continues.