Mohammed El-Halili told the High Court in Glasgow that he was driving Mohammed Abdi and other associates on the night he was killed.
Mr El-Halili recalled being chased by other cars through the streets of Edinburgh and then being rammed twice on a road in the Duddingston area of the city.
The court heard that Mr Abdi, who was carrying a baseball bat, then got out of the car along with an associate who was armed with a knife.
Mr El-Halili said he stayed in the car while "everything kicked off".
He described seeing several flashes and he saw Mr Adbi in a pool of blood but he fled the scene as he knew the police would arrive any second.
Mr El-Halili was giving evidence at the trial of seven men, who deny murdering Mr Abdi.
The court heard claims that Mr Abdi, 25, had been involved in drug dealing and that Mr El-Halili was a driver for him and his associates.
The jury was told of a another group operating in Edinburgh at the same time.
Prosecutor Iain McSporran asked Mr El-Halili if this was a problem and he replied: "There were words here and there. Obviously there was competition for customers."
The 21-year-old witness later told how he was driving Mr Abdi and two other men last May when they became aware of a Ford Fiesta and a people carrier nearby.
Mr El-Halili recalled "putting his foot down" before the other vehicles went after him.
He told how he was worried he and his friends would be "outnumbered" and that he was "nervous, anxious".
His car was eventually struck by the other vehicles and, asked by Mr McSporran how he felt at the time, the witness said: "I had just been crashed twice - how do you think I was feeling?"
Mr El-Halili recalled others in his car getting out, but he stayed put while the brawl started.
He said: "It seemed like forever [it was going on for], but it could have been seconds or minutes."
Mr El-Halili then told the jury how Mr Abdi went past his vehicle "with a big smile on his face" amid the apparent chaos.
The witness then described seeing "flashes", but was not aware how many.
He recalled doing a U-turn in his car to where Mr Abdi was.
Mr El-Halili told the court: "There was something wrong. I saw him on the floor in a pool of blood."
Despite this, Mr El-Halili and one of his friends left the scene as a police vehicle approached.
He and other men later went to the hospital where Mr Abdi had been taken - but the witness thought his friend had only suffered a neck injury.
Mr El-Halili added: "I was surprised, shocked. I had no idea how serious it was."
Mohamud Mohamud, 30, Ahmed Ahmed, 28, Cadil Huseen, 23, Hussein Ali, 26, Liban Ahmed, 30, - also known as Jama - Said Fadal, 32, and Said Tarabi, 27, deny murder.
The trial, before Judge Lord Turnbull, continues.