Two drivers raced at speeds of up to 90mph in a "game of cat and mouse" before a crash which killed three teenage girls, a court has heard.
The three girls were in the back seat of a Fiesta when it crashed
Gemma Cost, 15, Ursula Alokolaro, 16, both from Batley, and Natalie Donlan, 16, from Dewsbury, died in the crash in Huddersfield in September 2006.
Adam Anguige, 25, from Batley, West Yorkshire, denies three counts of causing death by dangerous driving.
The other driver, James Houston, 27, of Huddersfield, is unfit to stand trial.
Mr Houston had also been charged with three counts of causing death by dangerous driving.
The jury at Bradford Crown Court was told the crash happened when Mr Houston lost control of his car and collided with a lorry.
It happened as he tried to overtake Mr Anguige in Wakefield Road, Huddersfield, on the evening of 1 September 2006, the court was told.
Opening the case against Mr Anguige for the prosecution, Andrew Dallas told the jury Mr Houston had been deemed unfit to stand trial because he lacked the mental capacity as a result of serious injuries he suffered in the crash.
The court heard that on the night of the collision, Mr Anguige was driving his Vauxhall Nova "in convoy" with a Vauxhall Tigra towards Huddersfield when a silver Ford Fiesta, driven by Mr Houston and containing a front-seat passenger and the three girls in the rear, appeared to indicate it wanted the cars to pull over.
When they did so, the Fiesta allegedly sped past the vehicle with the occupants making rude gestures and swearing.
Mr Dallas said: "This surmounted to provocative behaviour.
"A wise motorist would ignore it but the effect on the drivers of the other two vehicles may be what James Houston intended and they set off after him.
"From then on the defendant and James Houston, in one way or another, were driving competitively, encouraging each other, in effect, both encouraging each other to drive dangerously."
"This was...a game of cat and mouse. Get in front and slow down to encourage more interaction with the vehicle behind."
As the two cars drove down Wakefield Road, a residential area which has a 40mph speed limit, witnesses described them as driving at "abnormally high speeds" in the region of 80 to 90mph.
The jury was told that, as the cars approached a left-hand bend, the Nova tried to overtake a Range Rover, while the Fiesta simultaneously tried to overtake the Nova.
The Fiesta then struck the side of the Nova before it appeared to lose control and spun into the path of an LDV flat-back lorry, the court heard.
Mr Dallas said the lorry was stopped in its tracks by the heavy impact and its driver was seriously injured.
The case was adjourned until Friday.