PROSECUTORS have accused the wrong man of killing Fremantle itinerant Randall Lee Duncan by stabbing him 21 times in a laneway, a defence lawyer says.

Jarrad Anthony Angliss is on trial in WA's Supreme Court, charged with murdering Mr Duncan, 32, between Collie and Nairn streets on September 4, 2012.

Prosecutor Linda Petrusa said the crown's case was that Mr Angliss, who was 18 at the time and also homeless, beat the victim during a dispute about infidelity, then stabbed Mr Duncan repeatedly as he lay injured on the ground using scissors that had fallen from his pocket during the assault.

Ms Petrusa said Mr Angliss's girlfriend had confessed to having sex with Mr Duncan, prompting the accused to attack his rival about five hours later in an alcohol-fuelled fit of jealousy.

She said forensic evidence placed Mr Angliss at the scene of the crime, including a broken bottle that had his fingerprints on it.

Forensic officers also found a bandage that had the blood of the accused and the victim on it, and Mr Duncan's blood was also detected on Mr Angliss's shoes and tracksuit pants.

CCTV footage showed he was in the area of the laneway about the time of the attack, and it also revealed another homeless man was with him for at least some of the evening.

Ms Petrusa said the other man might have been in the laneway, but he was not responsible for Mr Duncan's death.

She argued that Mr Angliss intended to kill Mr Duncan, saying some of the stab wounds penetrated as far back as his spine.

He had initially admitted the crime in police interviews and in phone calls to associates while in prison, saying in one conversation: “Yeah, I know, I f***** up wicked.”

But defence lawyer Beau Hanbury said while Mr Angliss might have done “many things against his interest”, he did not kill Mr Duncan. The perpetrator was the other homeless man, Mr Hanbury said.