A teenager accused of shooting a 15-year-old schoolboy said a video he sent to the victim's phone - in which he appeared to be threatening to shoot him - had been filmed by the victim while they were “messing around”.

During his second day in the witness box at Ipswich Crown Court, the boy - who cannot be named because of his age - accepted that in the video sent to the victim’s phone via Snapchat six months before the shooting he could be seen pointing an air rifle at the camera and saying: “I will shoot you. I will I promise.”

However, he said the video had been filmed in his bedroom by the victim in March last year and the words: “I’ll shoot you. I will I promise,” were a quote from an internet video.

He said the air rifle was a “prop” and the victim had been laughing while he was filming.

“This kind of behaviour was quite normal for us messing around together,” he told the court.

Earlier, the boy told the court he had been taking his mother’s antidepressant medication Citalopram since he was 14 after suffering from “anxiety, stress and panic attacks”.

The teenager, who is now 16, said a combination of “humiliation and bullying” by the victim of the shooting and his parents arguing had made him feel “upset and alone”.

He said he had taken one or two tablets a week but only when he was feeling upset.

On the morning of the shooting in September last year he had taken two tablets, he said.

He said he had read online that Citalopram was used to treat depression and panic attacks and he had continued taking the medication in the months before the shooting because he was feeling worse, rather than better.

He also claimed that a series of messages between him and a friend relating to meeting another boy to get a gun had been “role play” and was a joke which they had both found funny.

The 16-year-old has denied attempted murder, possession of a shotgun with intent to endanger life, wounding with intent to cause grievous bodily harm and possessing a shotgun with intent to cause fear of violence against a man who witnessed the incident.

The court has heard that he has admitted an offence of possessing a firearm with intent to cause fear of violence.

It has been alleged that the victim was deliberately shot as he was walking to Kesgrave High School, where he was a pupil.

The court has heard that on September 7 last year the defendant took his grandfather’s double barrelled shotgun and drove to Friends Walk in Grange Farm Kesgrave in his father’s car where he allegedly lay in wait for more than an hour before shooting the victim.

Riel Karmy-Jones QC, prosecuting, has alleged that the defendant - who was 15 the time of the alleged shooting - set out to kill the boy after planning the attack for a year.

Following the shooting, the defendant allegedly stood near the victim, who was lying in a pool of blood, with “no sense of urgency” and according to witnesses “appeared to have all day”.

A friend later told police that the teenager had been planning the attack for a year but he had wrongly assumed he was joking.

The boy had a “significant" injury to the side of his face and suffered a stroke after being taken to hospital, which had left him partially paralysed with some brain damage.