Giving evidence at Wolverhampton Crown Court, Arqash Zaffer said that he stopped his car after hearing a loud bang while turning into a street in Walsall at around 6.45pm on March 8 last year.
As he and three passengers got out of the Mercedes in Camden Street, Caldmore, up to 15 people - some apparently armed with machetes, axes and hammers - emerged from nearby Arena Park, it was said.
The Mercedes was peppered with shots during the incident, claimed Mr Glyn Samuel, prosecuting.
More from the trial:
Mr Zaffer claimed: “The first person I saw was somebody I now know to be Rohail Ali.
"He was holding what appeared to be a sawn-off shotgun. We heard somebody shout ‘shoot him, shoot him.’
“A shot was fired from the gun he was holding, directed towards us. Then the group charged towards us and started attacking with their weapons.
"I was struck in the face with a machete, hit on the head with a sharp, heavy object, maybe an axe.
"My right arm was cut and my left leg and back injured. The attack lasted a minute or two.”
He then drove himself to Walsall Manor Hospital from which he was later transferred to New Cross Hospital in Wolverhampton and detained for eight days.
Zaffer said he was ‘cruising’ round the area and could not offer any reason why he was attacked but admitted he did not report the incident to police.
An earlier attempt to start the trial ended when he failed to give evidence and he admitted only appearing this time because he faced being arrested if not.
He later identified four people – 21-year-old Ali, 20-year-old Zubair Mehmood, 30-year-old Amar Shazad and 32-year-old Mohammed Akram - who all live in Walsall and deny any involvement in the incident.
Zaffer conceded that he had difficulty remembering who did what but denied a claim from Mr Paul Lazarus, defending Mehmood, that he had been looking for a confrontation with people but was now too frightened to identify the real culprits.
He also dismissed a suggestion from Mr Zarif Khan, defending Ali, that he demanded up to £100,000 not to implicate that defendant.
Ali from Rutter Street, Mehmood of Arundel Street, Shazad from Victor Street and Akram of Primley Avenue, each deny attempting to murder Mr Zaffer and possession of a shotgun.
Shazad pleads not guilty to possession of a machete and Akram denies possession of a hammer or similar blunt instrument.
The case continues.