An 11-year-old boy stabbed his baby nephew in the stomach after the infant started crying, a court has heard.
The seven-month-old boy suffered life-threatening injuries at his home in North East Lincolnshire in December.
The accused, who had been playing on a games console, went into a bedroom and stabbed the baby with a kitchen knife, the jury at Hull Crown Court was told.
The boy, now aged 12, denies attempted murder and wounding with intent to cause grievous bodily harm.
Gary Burrell QC, prosecuting, said the boy told police: "(The baby) was in the bedroom next to me and started to cry dead loud."
He paused the computer game he was playing and went into the kitchen where he picked up a knife.
"Without realising that I did, I stabbed (the baby) and didn't realise that I did until it had happened," the boy said.
Doctors said the baby had made a good recovery after an emergency operation.
The baby was being cared for at the time by his grandmother, as her daughter - the accused's sister - was suffering from depression and had been sectioned under the Mental Health Act for her own safety.
The jury heard that two weeks before the incident the defendant had missed a class at school and had been seen by his form teacher.
When she asked him why he was not in class, she said he replied: "There's all sorts going on at home".
The boy had said he was worried about his sister who was in hospital.
He said his family were looking after her baby and that it was noisy at home. He told her: "The baby is doing my head in".
Giving evidence in court, the boy's mother described a noisy family life where there was no time to give her own son any attention
Her son "quite often cried a lot about his sister" who was ill in hospital and wanted his mum to give up looking after the baby so that they could get back to normal life.
Mr Burrell told the jury that it was accepted by both sides that the boy stabbed the baby, that the baby was seriously injured and that the injuries were life threatening.
"The only issue for you to determine in this case is whether (the defendant) had the necessary intention to be guilty of any of these offences."
The trial continues.