The victim, from Walton, has not yet been named but is said to have collapsed in the street as members of the public ran to his aid.

Police are trying to trace a small white van seen in the area at the time of shooting.

A Merseyside Police spokeswoman said: "Staff at the prison called police when they were alerted by a concerned member of the public who had gone to the aid of the victim after he collapsed close to the front entrance of the prison.

'Targeted' shooting

"The 19-year-old, who is believed to be from the Walton area, suffered a gunshot wound to the head.

"He was taken to hospital but died of his injuries.

"It is believed the victim had been visiting a friend at the prison and was shot as he walked away from the entrance."

Roads around the prison entrance were cordoned off on Thursday while scenes of crime officers gathered evidence.

Detectives are also examining CCTV footage from the area.

The spokeswoman added the motive for the attack was not yet clear although it was believed to be a targeted shooting.