Michael Jackson's two eldest children watched as the doctor charged over the singer's death frantically attempted to revive him in the bedroom of his rented mansion, a bodyguard said.
Faheem Muhammad told the Los Angeles court that Dr Conrad Murray appeared panicked as he performed chest compressions on the singer on a bed.
Mr Muhammad said the doctor asked at one point whether anyone knew CPR. The guard said he saw Jackson's children Prince and Paris watching their father on the bed with his eyes and mouth wide open. He said Paris was crying on the floor and he eventually escorted the children from the room.
The evidence came during a preliminary hearing to determine if Murray, Jackson's personal doctor, will be tried on a charge of involuntary manslaughter.
Authorities argue that Murray gave Jackson a lethal dose of the powerful anaesthetic propofol and other sedatives in the bedroom of the mansion before he died on June 25 2009.
Earlier a choreographer who worked with Jackson on his ill-fated concert tour told the court he clashed with Murray and others over the superstar's health six days before he died.
Kenny Ortega said he was summoned to 50-year-old Jackson's home a day after letting the singer skip rehearsal because he seemed sick.
Murray and others suggested Jackson should not have been sent home because he was physically and emotionally fine, Mr Ortega said, adding he was told not to try to be Jackson's doctor or psychiatrist.
At the end of the multi-day hearing, a judge will determine whether there is enough evidence for Murray to stand trial.
The Houston cardiologist has pleaded not guilty and his lawyers have said he did not give Jackson anything that should have killed him.