A teenager accused of raping and murdering six-year-old Alesha MacPhail has told a court he would “never do something like that”.

The 16-year-old, who cannot be named because of his age, said he “never met Alesha MacPhail in person” when asked if he had attacked her on the Isle of Bute last July.

Asked if he “brutalised” her, he said: “It’s not me, absolutely not. I would never do something like that.”

Questioned if his “DNA is all over her” because he murdered and raped her, he said: “No”.

He also denies abducting her and attempting to hide evidence.

On Tuesday, giving evidence at the High Court in Glasgow, he said he had been “fairly frequently” having sex with the woman he is blaming for Alesha’s death, Toni McLachlan, the girlfriend of Alesha’s father.

He said from October 2017 for most of the the winter they were “friends with benefits” and were “meeting up, having sex, smoking joints”.

He said her partner Robert, or Rab, MacPhail did not know as he and Ms McLachlan were still a couple and she would complain he was abusing her.

The accused said in the early hours of July 2, the day Alesha’s body was found in woods on the island, he and Ms McLachlan messaged on Instagram and met for a cigarette.

Alesha MacPhail funeralThe order of service for the six-year-old’s funeral (Lesley Martin/PA)

They met in a shelter outside the home where she was staying with Mr MacPhail, Alesha and her grandparents, then went to a garage and had sex, before going their separate ways, the court heard.

He said this was where he was heading when he was shown on CCTV leaving his home.

He has lodged a special defence of incrimination, blaming Ms McLachlan.

He told the court he believed she retrieved the condom he threw away in the garage.

He said: “Toni’s took the condom when I left. She’s went and killed Alesha.”

He said he believed Ms McLachlan had been planning the murder.

“I don’t think it’s something that you would do spontaneously,” he added.

“She could have been fantasising about it for months. I really don’t know, I’m not her.”

He said alleging she had murdered Alesha if it was not true would be “evil”.

The teenager said he “lied” to his mother and the police about what he did on July 2 out of concern for Ms McLachlan, but denied being a “confident liar”.

He said he did not want to tell them about having sex with Ms McLachlan that night as he feared it would get back to Mr MacPhail.

“I didn’t want her to get hurt. I didn’t want her to get hit by Rab,” he said.

The accused told the court after having sex he and Ms McLachlan chatted for a while and that afterwards he went home and had a shower.

He said he then realised he did not have his phone and went outside to look for it, but it was too dark so he came back to get a torch and shoes.

He went out again and managed to find it then came home and went to bed, and said this explained his movements captured on CCTV at his home.

In the morning he woke to see that Ms McLachlan had phoned him at around 6.30am and he replied saying “sorry it doesn’t matter”, saying he said that “for Rab’s benefit” to make it look as though he and Ms McLachlan had not spoken.

He said he then received another message from her saying that Rab’s little girl was missing.

Toni McLachlan and Robert MacPhailToni McLachlan partner of Robert MacPhail (behind) at the High Court in Glasgow (Andrew Milligan/PA)

Defence agent Brian McConnachie QC asked the accused about a video he posted on social media that day which showed his top half with the written message “found who done it”.

The accused said: “It was a video of my feet walking to the bathroom and the camera points up to the mirror and I pretend to get a fright and it says ‘found who done it’.

Asked why he did that, he replied: “People were talking about who might have done it and one of my friends said my name and I didn’t want to take it to heart so I just thought I would build on it.”

Mr McConnachie said: “You were making people know you were responsible.”

The accused replied: “No, we didn’t even know it was a murder at that time, we were just speculating.”

Questioned about messages he exchanged with a friend where he says he would maybe “kill one day for the lifetime experience”, he said these were “not serious”.

He said the conversation was started by the friend, adding: “It would ruin your life if you ever killed anybody.”

Giving evidence last Wednesday, Ms McLachlan denied being responsible for Alesha’s death, saying she “loved” Alesha.

She also denied suggestions by the defence that she had sex with the accused on July 2, then planted his semen on Alesha, before “attacking and brutalising her” and murdering her.

The court earlier heard DNA matching the accused was found on Alesha’s body and clothes, with some samples at odds of a billion to one of being his.

The trial, before judge Lord Matthews, continues on Wednesday.