However, the stunned, innocent occupants of a Cork city apartment did not know what was happening as he had the wrong building.

After hearing of Jamie O’Keeffe’s actions, Judge Séan Ó Donnabháin said yesterday: “This is bizarre.”

Det Sgt Vincent O’Sullivan agreed, and said it was “mad stuff”.

O’Keeffe, 25, had been drinking on the beach in Youghal and came up with the idea to rid a building in Cork of heroin dealing.

As well as ‘taking the law into his own hands’ on the issue, he also found himself smashing his way into the wrong apartment.

Det Sgt O’Sullivan told Cork Circuit Criminal Court the accused had gone to an old Georgian building on Windsor Place in Cork at around 11pm on June 25.

“He kicked in the door and threatened the occupants with a knife telling them to stop dealing heroin,” said Det Gda O’Sullivan. “They were not taking much notice of him and he took mobile phones and keys and left the building.

“He said during an interview by gardaí he got it into his head there were heroin dealers in the house. He was wrong. He went into the house in a lone vigilante moment.

“He was very drunk. They [the people in the apartment] were not too sure what he was on about. He is easy enough to deal with when he is sober.”

Sinead Behan, BL, said: “It was an impulsive decision of his that they were drug dealers in the house.”

She said O’Keeffe was a talented artist who previously won a competition to design a penthouse.

O’Keeffe, of 219 Comeragh Park, The Glen, Cork, was remanded in custody until February 25 for sentencing.