A Sydney real estate agent was caught hiding cocaine in his underwear after he was taken into custody for standing outside a house at night.

According to The Daily Telegraph, Theodore Penemenos pleaded guilty in Bankstown Local Court on Thursday to possessing drugs and possessing suspected stolen goods, but was not sentenced having applied to have the matters dismissed on mental health grounds.

Court documents state that the 31-year-old had previously pleaded not guilty to the two charges in May last year.

Agreed facts tendered to the court state police were responding to reports of a man outside a Padstow Heights home when they came across Penemenos at 1am.

When speaking with him, they found he had a woman’s passport but he could not explain why.

He was found to be in breach of earlier bail conditions and was taken into custody at Bankstown Police Station.

Penemenos spent the night jail and the next morning was seen fidgeting with something in before placing it on the bench behind him.

He stood up, put his back to the CCTV cameras and placed one leg on the seat in front of him, appearing to fiddle with his “groin and upper leg area” while repeatedly looking over his shoulder, documents state.

When police questioned him he said he was “playing with his penis”.

He was later seen taking an item on the bench behind him and trying to hide it in his underwear.

Following a minor tussle, police found a small sealable bag with 9.4g of cocaine.

Penemenos punched the perspex screen with his left hand several times, which the documents state broke his finger, leading to a hospital visit.

He remains on bail and will return to court on July 24 where the mental health application will be heard.