A Rosyth teenager caused damage and disruption at the Dunfermline Sheriff Court building.
Levi Taylor was being held in the cells area when he smashed a window and climbed through it.
Taylor, 18, of Elder Place, is now in detention and appeared by video-link at Dunfermline Sheriff Court.
He admitted that on February 27 at the custody cells area he shouted, swore, acted aggressively and kicked a glass window damaging it.
He climbed through the broken window, struck a chair against a door, damaged the chair and used the arm-rest to cause damage to a door.
He then placed his arm through the broken window and unlocked the door from the inside, brandished the arm-rest at custody staff and struck the spyglass of a cell door, damaging it.
Sheriff Charles Lugton deferred sentence until October 11.
Taylor is currently serving a period of detention for another matter.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here