A teenager accused of second-degree murder in Sydney stabbed the victim in a jealous rage, according to the testimony of one witness.

The witness described herself as a longtime friend of the grandfather of the accused. On the day of the incident, she stopped by the home with her own grandson to drop off a meal to the grandfather.

She told the court on Wednesday morning that the accused — who was 16 years old at the time of the December 2010 incident — came out of the home, sat in her van and said, "You got to come see. You got to come see."

When the witness went inside the house, she said she saw the accused kneeling by the bleeding victim, saying, "I killed her. I think I killed her, I don't want to go to jail."

The witness testified the accused told her, "I had to, she cheated on me."

Court heard the accused then came out of the bedroom with a knife and said he had to kill them all because they were witnesses. The witness testified she left the house and called 911 from a nearby Needs Convenience Store.

A police officer who responded to the scene also testified on Wednesday, saying he saw the accused walking about a block from the scene, dressed only in shorts — with no shirt or shoes. The officer told the court there was blood smeared on the teenager's face and hands.

Earlier this week, a pathologist testified the victim could have been unconscious when she was repeatedly stabbed, and she may have already been dead when many of the wounds were inflicted.

The 17-year-old girl had 104 stab wounds, from several knives. The identities of the accused and the victim are protected by the Youth Criminal Justice Act.

Dr. Marnie Wood testified on Tuesday that the victim didn't have any marks on her hands or her forearms, which means it's unlikely she had an opportunity to defend herself.

The victim had alcohol and drugs in her blood at the time of her death. The accused appeared agitated during the testimony, playing with the Velcro on his sneakers and shifting in his seat.

The Crown said the trial could take up to 10 days and involve almost 20 witnesses.