A 50-year-old man turned himself in to police after pulling out a knife in a courtroom at the High Court on Hong Kong Island on Tuesday morning.

The man surnamed Yu, a mainland Chinese from Fujian province who has lived in Hong Kong since 2008, was seated in the public gallery in Court 13 on the seventh floor of the High Court, where Judge Wilson Chan Ka-shun was hearing a contempt of court case, Apple Daily reported.

At 10am, Yu suddenly took out a 20-centimeter-long knife and shouted in Putonghua, ”It was lawless. How do you think you could hide from me?”

Judge Chan left the courtroom immediately while Yu escaped without injuring anyone.

Over 50 police carrying shields were stationed at all entrances to the building but the man could not be located.

At 6pm, Yu appeared outside the Police Headquarters in Wan Chai before entering the police station. He told media that he regretted his actions and apologized to the judge and the public for what he did in the morning.

He was arrested for alleged criminal intimidation.

Yu was accompanied by Democratic lawmaker Lam Cheuk-ting, who persuaded Yu to turn himself in when Yu went to Lam’s office in Sheung Shui for help, Wen Wei Po reported.

Yu told journalists he had previously been accused of assaulting a police officer and was found not guilty. He said he was angry with the judicial system after failing to get compensation in relation to the assault charge, Radio Television Hong Kong reported.