Simon Maclellan had shared a cell with his twin brother
A prisoner has pleaded guilty to attempting to pervert the course of justice by switching identities with his twin brother.
Simon Maclellan, 27, of Gosport, Hampshire, was on remand at HMP Winchester for a serious assault.
He was wrongly released from custody on 10 July after pretending to be his brother Mark, who was on remand for a lesser offence and due to be released.
Maclellan pleaded not guilty to another charge of escaping from lawful custody.
Portsmouth Crown Court heard Maclellan had been sharing a cell with his twin brother at Winchester Prison and there was a mix-up with the dates of court appearances for the two brothers.
Maclellan said he believed he was due to appear in court that day and when he was collected from his cell, the prison guard only checked his surname and not first name.
The court heard that when he was later released from custody at Fareham Magistrates' Court he claimed he only took advantage of the case of mistaken identity.
He said it was not a pre-planned attempt to escape from prison.
Maclellan was arrested the following day at an address in Fareham.
Dan Sawyer, prosecuting, said the prison guard had checked both surname and first name as well as prison number before Maclellan was taken from his cell.
He added that the not guilty plea to the second charge was acceptable.
Judge Ian Pearson ordered a Newton hearing on 17 December to determine whether Maclellan's reasons for pleading guilty are acceptable to the Crown Prosecution Service (CPS). Maclellan was remanded in custody.
A Newton hearing can occur when the defence and prosecution dispute the facts on which the court would impose sentence