The killer of Bailey Gwynne described the school stabbing which shocked Scotland as a "moment of anger".

Over five days, a jury at the High Court in Aberdeen heard the events which led up to the killing at Cults Academy last year.

Bailey had rowed with the fellow pupil at the end of the school lunch break on October 28 after refusing to give a biscuit to another boy. A fight broke out and the 16-year-old plunged a blade into Bailey's chest, piercing his heart.

Head teacher Anna Muirhead was among the first people to arrive after Bailey collapsed.

She told the court: "I saw Bailey lying on the ground with various members of staff next to him. I knew immediately it was very serious."

Paramedic Gary Gillespie arrived at the school minutes later and began the fight to save Bailey's life.

He said: "He was probably the palest person I've ever seen. He was gasping for breath. His paleness indicated catastrophic blood loss and it was clear early on that it was a huge internal blood loss.

"I asked a member of staff to raise his feet to get more blood to his organs. I cut off his blazer and managed to get IV access to put a plastic tube into one of his veins.

"The ambulance crew arrived and it was about that point the patient's heart stopped. I started chest compressions but there was no change in his condition. He was placed in an ambulance and we left the scene."

Mr Gillespie said there was nothing else he could have done to save Bailey, who was declared dead at Aberdeen Royal Infirmary.

Pathologist Dr James Grieve said he was not surprised the wound was fatal.

He told the court: "The stab wound penetrated through the muscle and fat between two ribs into the heart. Having seen the reports of paramedics and emergency workers I am in no way surprised what the outcome was."

The 3.3in knife was illegally bought by Bailey's killer from online retailer Amazon and delivered to his family home.

Computer analysts found Google searches on his laptop including "illegal knives UK", "Aberdeen stabbings per 1000", "difference between homicide and murder" and "knuckledusters UK".

The 16-year-old told officers he bought the knife online "because they don't check if you're over 18". It is illegal to sell folding knives with blades more than three inches long to under-18s in Scotland.

He paid £10 for the knife and £40 for a set of knuckledusters, which he carried to "act tough and be cool".

One witness told the court he had seen him with a knife at school "maybe 25 times" before the stabbing.

During a police interview the day after the stabbing, the 16-year-old said he had "never fitted in" and described himself as "fat". Witnesses said he had often been teased for his weight.

The 16-year-old sobbed when he was told he was being charged with murder at the end of the interview, which was played to the court.

He was found guilty of the lesser charge of culpable homicide at the High Court in Aberdeen and sentenced to nine years detention on April 1.