Jake Dykstra is accused of helping Declan Graves get back to his home city of Liverpool after he had murdered a teenager on a Shrewsbury housing estate in 2016.
Dykstra, 20, of Anselm Avenue, Bury St Edmunds, denies the charge.
Graves fatally stabbed 16-year-old Michael Warham in Moneybrook Way, Meole Brace, during an altercation involving two groups of men, Shrewsbury Crown Court was told.
He was jailed for life in September last year, and will serve a minimum of 20 years in prison.
The court heard that Graves stayed with Dykstra in Market Drayton, before a friend of his, Steven Roberts, a drug user, took him to Liverpool.
Prosecutor Siobhan Collins told the court how Mr Warham was stabbed on August 1, 2016, when a confrontation had taken place between two gangs from Liverpool. She said the dispute was believed to be over drugs.
Some of the gang fled the scene,but Graves took refuge in a nearby garden. He asked the homeowners for help, and at the same time hid the murder weapon in some bushes. The couple then took him to Meole Brace Retail Park, where he met with two associates.
The jury heard that Dykstra was not at the scene of the murder or nearby, but the following day he contacted a friend, Mr Roberts, who he sold drugs to and asked him for a lift.
When arriving at an address, Roberts met Dykstra, Graves, a man known as 'Jesus', and another unknown male.
Roberts took Jesus and the unknown man to Shrewsbury, then on to Welshpool and Newtown where he dropped them off.
The prosecution alleges that Graves then went to stay with Dykstra in Market Drayton.
Ms Collins told the court that on August 4, after Mr Warham died in hospital, Mr Roberts received a call from Dykstra asking him to pick him and Graves up in Market Drayton.
Mr Roberts then took Dykstra and Graves to Meole Brace, where they entered a garden, before returning to his van and going back to Market Drayton.
On the way back, Graves asked Mr Roberts if his van would make it to Liverpool, and offered him £100.
Later that day, Mr Roberts took Graves to Speake in Liverpool, with the prosecution saying Mr Roberts was not aware of what was going on.
Two weeks later, Graves was arrested on suspicion of murder.
The prosecution showed evidence of messages on Dykstra's Instagram account, saying Graves 'never meant for it to happen', and that he was going to hand himself in.
Miss Collins said: "He knew full well what had gone down on August 1."
The trial continues.