A prisoner was murdered by three inmates in a violent feud over the control of a "lucrative" contraband route into the jail, a court heard.
Basana Kimbembi, 35, Robert Butler, 31, and Joshua Ratner, 27, deny murdering Jamal Mahmoud, 21, at London's HMP Pentonville on 18 October 2016.
Prosecutor Mark Heywood QC told the Old Bailey that Mahmoud "was killed with calculated brutality".
Mr Heywood said the group specifically targeted him and those with him.
The three defendants also deny wounding another prisoner, Mohammed Ali, on the same day.
Mr Heywood told jurors: "When it happened, both sides knew that it was going to happen and were prepared to engage in it."
The alleged killers "did so to make their point and to succeed in resisting the others and getting control of part of the lucrative contraband route onto that wing of the prison," Mr Heywood told the court.
The court heard Mahmoud was part of a group on G wing of Pentonville known as "the Somalis", which included Ali.
The pair had occupied key cells on G Wing from where they had power over phones, weapons and drugs as they were delivered to the prison by drone or other methods.
By mid-October last year, a "serious dispute" had developed over this access to contraband, the court heard.
The victim was seen by another inmate to visit Butler and Kimbembi in a cell, where Kimbembi threatened Mahmoud with a large combat knife and said "I am going to kill you", the court was told.
Mr Heywood said: "Whatever he meant by those words, the fact is he did. He did so within about 24 hours."
The day before the killing, a package had come into the prison and there was open talk of a "beef". It was clear weapons were on the wing, jurors were told.
The stabbing took place just after 3pm, outside cells in an area not covered by CCTV.
According to a witness, the violence began with Butler punching Ali in the face. He pulled out a flick knife and jabbed towards the victim, it was said.
Kimbembi then stabbed Ali in the back and grabbed Mahmoud before plunging the blade into his chest, the court heard.
Mr Heywood told jurors: "It was effectively an execution."
As Mahmoud was being treated, Kimbembi went for him again, pushing prison officers away and kicking him several times, the prosecutor said.
Ali had a can in a sock and a kitchen knife was seen to fall from Mahmoud's trousers, jurors heard.
Pentonville prison has been criticised by HM Inspectorate of Prisons for being overcrowded, run-down and violent, and saw two inmates escape in the last year.
The trial continues.