Keelan Wilson suffered fatal knife wounds yards from his home in Merry Hill, Wolverhampton, May 29, 2018.
Three different acts of violence between the 'V3' and 'V2' gangs in the city resulted in the schoolboy being "executed" in the back of a taxi, Wolverhampton Crown Court was told.
Four 19-year-old men are accused of murdering Keelan: Brian Sasa, Tyrique King, Zenay Pennant-Phillips and Nehemie Tampwo.
Opening the case on Wednesday, Mr Michael Duck, prosecuting, said Keelan had more than 40 knife wounds, at least three of which could have been fatal individually.
'Well-planned and coordinated'
He said: "It's a matter of real sadness that people of such youth have the willingness and capacity to take the life of another person as the prosecution say they did.
"It's not just the fact they took that life but the manner they chose to do it.
"It wasn't a split-second reaction, this was a well-planned and coordinated group attack by a number of youths armed with knives and I make no apology for saying it was planned to execute another young man."
Keelan was sat in a taxi with a close associate and the driver of the taxi just before 11pm when the group pulled open the rear door, which momentarily protected him, and set about with weapons, Mr Duck said.
"That act was committed by a group under the gaze of members of the public and they knew it to be so," Mr Duck added.
"The prosecution say that's telling in itself.
"The taxi driver sustained a minor cut, the other man of a similar age who had been in Keelan's company sustained no injury at all.
"The prosecution say there is the plainest evidence of Keelan Wilson being a target who was to die.
"The reality is he died while he lay in the street.
"These four defendants were part of that group, they left a nearby address in a taxi."
Machetes, shotgun, murder
The first violent incident took place the day of Keelan's death in Wolverhampton city centre at about 3.40pm where hooded youths were seen waving machetes near Markies Barbers. One of the youths was a friend of Keelan's, who had come out of the barbers, Mr Duck claimed.
The jury was shown CCTV of the incident and of two people Mr Duck says are King and Sasa who were in the area at the time.
Then in Legge Street, just after 5pm, a man the prosecution says was Keelan Wilson was seen on CCTV walking down the road.
Two men - one on foot and one on a bike - chased after him before a shotgun was fired in Keelan's direction, the prosecution claims.
Mr Duck also said a Honda associated with Keelan drove into the bike, but the rider jumped out of the way in time.
The third violent incident resulted in Keelan's death.
Police were called to reports of a group of youths fighting in Langley Road and Keelan was taken to hospital with serious injuries, but was confirmed dead a short time later. A post-mortem confirmed he died from stab wounds.
"There was plainly a plan to execute retribution on Keelan Wilson. This was not a murder by chance, it was a murder by design and plan," Mr Duck said.
"The plan started with these four and others."
He added: "There can be no doubt that Keelan Wilson, young as he was, had been embroiled in gang culture by 2018.
"There will be evidence that suggests that he was a member of a particular gang identified by a postcode."
Sasa, of Long Ley, Heath Town; Tampwo, from Fern Grove, Bletchley; King, of Chelwood Gardens, Bilston; and Pennant-Phillips, whose address cannot be published for legal reasons, all deny a single charge of murder.
The trial continues.