A convicted robber who escaped a high-security prison simply by walking out of the door had twice before escaped from the same prison, a court heard.

Haroon Ahmed, 26, alleges that he joked with an officer at the HMP Dovegate in Staffordshire before conveniently escaping.

"Nothing was planned. I just got up when the visit was ending. I said to a prison officer 'Is it okay for me to go home?' as a joke. I just walked off with all the visitors and went through the security procedures," said Ahmed.

He was later re-arrested on 1 June in Nottingham after being on the run for five days despite his claims of having fled to Marbella.

As he appeared at the Burton Magistrates' Court, it was revealed that Ahmed from Derby had two previous convictions for similar prison escaping incidents.

"He has deliberately escaped from a category B prison while serving an indeterminate sentence. He has previously escaped and has numerous disposals to commit an offence," said prosecutor Emma Thompson, reported The Independent.

Ahmed was surrounded by twice the usual number of security guards as he appeared in court.

An investigation has been launched by the Category B private prison run by Serco.

"We are taking this extremely seriously and I have commissioned an urgent investigation into the circumstances of the escape," said Serco's director at HMP Dovegate, Michael Guy.

"We are working closely with the police to identify what went wrong and to address any failings."

Ahmed was reportedly on an internal watch list of inmates most likely to attempt escape. He will appear at Stafford Magistrates' Court on 29 June.