The teenager repeatedly punched Euan Craig in May this year.
Euan, also 14, slumped to the ground in front of classmates at the school in Glasgow, which cannot be identified for legal reasons. He later died, having suffered a freak head injury.
His attacker, who also cannot be named, yesterday pled guilty to a charge of culpable homicide at the High Court in Glasgow.
A judge warned the schoolboy – described as "quiet and reserved" – a custodial sentence was the likely outcome when he returns to the dock next month.
Euan's family and friends, including parents Richard and Anne, packed the court to hear of the tragic events of May 23.
Prosecutor John Scullion told how the teenager and Euan were third-year pupils at the school, but were not friends.
The pair were attending separate PE classes on the morning of the attack.
Euan and his friends began "messing around" with a sponge ball while waiting for their teacher to arrive.
The killer entered the gym as Euan picked up the ball and threw it at a friend. However, it missed the other boy and struck the accused on the side of the face. He then yelled at Euan: "What the f*** are you doing?"
Mr Scullion told how the boy strode towards Euan, who immediately apologised.
The prosecutor continued: "The accused punched the deceased approximately five times to the left side of the head.
"The deceased tried to back away and tried to block the punches by covering his face.
"During the attack, the deceased continued to apologise, saying: 'Sorry, I didn't mean it. It was an accident'."
The accused eventually stopped and walked out of the gym hall.
Euan went over to sit beside other pupils, repeating that what had happened with the ball was an accident. He then suddenly slumped from the bench and started to suffer a seizure.
A teacher raced over to help, but Euan did not respond. A 999 call was made before the boy was taken to Glasgow's Southern General Hospital. A CT scan revealed he had extensive bleeding on the brain. Euan never recovered and was pronounced dead the next afternoon.
A pathology report concluded the fatal haemorrhage was caused by Euan being hit on the left side of his face.
Mr Scullion told the court that the blow "need not have been hugely powerful", but forceful enough to cause a "rotation of the head with such unpredictable and devastating consequences".
The killer's QC said what happened was "catastrophic" and that his client had displayed "huge remorse" since. Ian Duguid, defending, added: "He cannot remember acting in such a way before. This was an event that is entirely out of character. He comes from a background and a family where there are comparatively high standards of behaviour and expectations of achievement."
A school report also revealed he was generally well-behaved and was described as "quiet or reserved".
He has been banned from going near the school since he made his first court appearance in May this year.
Lord Bracadale allowed him to remain on bail and deferred sentencing until November 23 at the High Court in Edinburgh.
The judge told the 14-year-old: "Whatever the sentence for you, it will not bring back Euan Craig. His bereft family have to live with the loss of a boy who was violently and untimely taken."
Euan's family made no comment as they left court.
Contextual targeting label: