A six-year-old boy died because of neglect by hospital staff who failed to realise he was seriously ill, a court has heard.
Jack Adcock died in Leicester Royal Infirmary after a series of failings, including a doctor mistakenly believing he was under a "do not resuscitate" order, a jury was told.
Medical staff were stopped from giving life-saving treatment to the youngster by Hadiza Bawa-Garba before the error was picked up by a junior doctor.
Nottingham Crown Court heard that Bawa-Garba had confused Jack for another patient she had treated earlier in the day, in what prosecutor Andrew Thomas QC called a "remarkable error".
He added that while Jack, of Glen Parva, Leicester, was "beyond the point of no return" and that resuscitation was "futile", it suggests Bawa-Garba, 38, had not given the youngster "sufficient care".
The doctor along with nurses Theresa Taylor, 55, and 47-year-old Isabel Amaro have been charged with manslaughter through gross negligence. All deny the charge.
Jack was admitted to the infirmary in February 2011 suffering from vomiting and diarrhoea and developed sepsis.
Mr Thomas told the jury: "We say that Jack's death was caused wholly or in part by serious neglect on the part of the team on the children's assessment unit."
The court heard that Jack was admitted on the morning of February 18 2011 after falling ill during the night.
His GP said he should go to hospital, where medical staff "failed to act on obvious symptoms of serious illness", said Mr Thomas.
It is alleged that staff did not monitor Jack's condition effectively, and failed to recognise high levels of blood gas and lactate as concerning.
Jack collapsed at 7.45pm, with prosecutors saying his lips had started to turn blue, and a paediatric arrest team were summoned.
Nicola Adcock, Jack's mother, described the moments shortly after the collapse.
She told the jury she was ushered out of the room, before a member of nursing staff said "he needs his mummy".
She said: "I got told we are doing everything we possibly can."
She then added the treatment then stopped.
"He was just lying there. It looked like he was fast asleep," she said.
"Someone came running in the room and said 'no he can have everything'.
"I was just going hysterical at the door."
Mr Thomas said: "During this critical period an event occurred which you may think is powerful evidence of Dr Bawa-Garba's performance that day.
"When she came into the bay, almost immediately she called the resuscitation off.
"She told the other doctors Jack had been marked down as do not resuscitate earlier in the day."
A first-year doctor then re-read the notes and said she could not see a DNR entry.
Mr Thomas said: "It was a remarkable error for a doctor to make. Dr Bawa-Garba was later to explain she had mixed Jack up with another child she had been treating on the children's assessment unit.
"But there was no basis for that confusion. Jack was a six-year-old boy with Down's syndrome who had been transferred to ward 28 to treat his pneumonia. The other child was a two-year-old who had been discharged home earlier that day. The confusion is inexplicable."
The court also heard that nurses Amaro and Taylor gave Jack a paediatric observation priority score (pops) of four when he was admitted.
Mr Taylor suggested a score of seven or eight would have been more accurate, which would have suggested Jack was in a critical condition.
He said: "We say that the failings of each of the defendants contributed significantly to Jack's death.
"There was of course an underlying natural illness - the lung infection - which had led to sepsis and septic shock. But the lack of care contributed to Jack's death.
"It was a needless death."
The court heard the three members of hospital staff on trial will say their conduct was "appropriate".
The trial is expected to last up to five weeks.