He was in the dock along with brother-in-law Andrus Giedraitis, 29, over the alleged murder of Latvian Ivans Zdanovics, 24.

Mr Zdanovics died from smoke inhalation in January 2014 at his house in Gainsborough, Lincolnshire.

The Ministry of Justice has now launched an investigation into what happened.

HMP Lincoln has previously been criticised for being overcrowded and suffering from staffing issues.

Frances Cook, chief executive of the Howard League for Penal Reform, said: "It is ridiculous and dangerous that a murder suspect was released during his trial.

"I’ve never heard of this happening before and I am deeply concerned. We should be relieved that Kupstys simply sat at a bus stop wondering why he had been pushed out the door. Thankfully nobody was hurt."

The trial is expected to resume next March.

Peter Wright, governor of the prison, said it was "a grave error, a fundamental breach of what we’re here to do."