A 17-year-old boy has told a jury he did not mean to kill another teenager who died after being stabbed in a street fight.
Irfan Wahid, 16, died in hospital after being attacked in Harehills Lane, Leeds, on 10 February.
Leeds Crown Court had earlier heard that the fight had been caused by a dispute over a girl.
The 17-year-old, who cannot be named because of his age, has denied murder and manslaughter charges.
He told the jury that he had swung a knife, which he carried in his bag to defend himself, after being punched to the ground by Irfan and others.
He said it was only when he saw blood on the weapon that he realised what had happened.
The defendant said he had run away, threw the knife down a grate and burned his clothes.
He said he felt terrible when he found out Irfan had died and after spending a night sleeping in a car, he handed himself into police.
Earlier, the jury had been shown video evidence from the girl over whom the boys had been fighting.
She dated the defendant in 2016 and had spent time with Irfan a few days before the stabbing.
The girl said she had sent the defendant a message saying she still cared about him and wanted to see him, and it was that meeting which led to the fight between the boys.
The trial continues.