The murder trial has begun for three men accused of killing a truck driver who was struck by a stray bullet from a gunfight in a western Sydney car park.

Adel Elkobaili, 21, Mahmoud Mariam, 28, and a juvenile, now aged 20, appeared before the Supreme Court charged with murdering Canberra truckie Robert Knight as he drove along Milperra Road on June 25, 2009.

The three accused are also charged with affray, while the juvenile is charged with setting a van on fire.

They have denied the charges.

Giving his opening statement, crown prosecutor Pat Barrett told the jury two groups of men got into a fight at a Campbelltown shopping centre on the day of the gunfight.

The groups, one including Elkobaili and the juvenile and the other including Mariam, then arranged to meet at the KFC car park on Milperra Road later that night through a series of phone calls, Mr Barrett said.

When the groups met, they started firing at each other and a stray bullet hit Mr Knight as he drove past, killing him.

Mr Barrett said the court would hear Mariam fired the fatal bullet that hit Mr Knight.

The prosecutor argued while none of the accused intended to kill Mr Knight, this was irrelevant as they all had entered into an agreement to inflict grievous bodily harm on members of the opposing group.

"You may be sure none of the accused intended that Mr Knight, a person unknown to them, a passer-by, was to be killed," he said.

"[But] as a result of that agreement, the death of Robert Knight took place."

The trial continues before Justice Megan Latham.

AAP