A young inmate desperately tried to get back into a cell block at a new €45m prison after being left locked into an exercise yard overnight.
New control procedures are expected to be put in place for nightly cell block lockdowns after the incident in Cork Prison, which is now the focus of a major Irish Prison Service (IPS) investigation.
The inmate, in his 20s, has since been granted temporary release.
However, he is understood to have been locked into the exercise yard for more than 12 hours after the bizarre incident on March 2.
The incident occurred despite the fact the high-tech prison boasts more than 300 CCTV security surveillance cameras.
However, the prisoner's plight was recorded on CCTV cameras covering the exercise yard.
The man became so cold that he began doing exercises, including star-jumps, and jogging in front of the security cameras in a desperate bid to attract attention to his plight.
The young man also spent several hours shouting for help - but the ultra-secure nature of the new prison complex meant he was not heard.
It is understood his predicament was only discovered the following morning when prison staff began their morning head count - and discovered there was a discrepancy involving one prisoner.
Just as concerns were voiced over the inmate count, a prison officer heard the desperate shouts for help from the prisoner in the exercise yard.
The young man was brought back into his cell at 7am.
The IPS confirmed that a full investigation into the incident is now underway.
The investigation is expected to be concluded shortly, but its findings will not be published.
Under routine procedures, prison authorities will not discuss security issues or the identities of inmates.
One prison source indicated that the incident is believed to have been caused by the young man returning to the prison from a district court appearance in Kerry.
He was permitted access to the exercise yard by some prison staff on his return - but other staff, on nightly lock-down duties, were apparently under the impression the man was still absent from the facility.
It remains unclear how his presence in the exercise yard went unnoticed as all other inmates were escorted back to their cells for their evening meal and nightly lockdown.
The €45m new prison opened in January and replaced the old Cork Prison which was one of the most overcrowded within the Irish prison system.