A serving policeman was warned he could be jailed for allegedly approaching one of Northern Ireland's top judges and threatening to arrest him.
Lord Justice Gillen told Thomas Anthony Carlin his actions at a hearing in Belfast amounted to prima facie contempt of court.
He has been given until Thursday to secure a lawyer, explain his behaviour and apologise.
The PSNI confirmed that a 43-year-old man remained in custody after being detained on suspicion of two counts of common assault at the Royal Courts of Justice.
The Police Ombudsman has also been notified.
Mr Carlin's outburst came at the end of a ruling in a house repossession case at the High Court in Belfast.
He was representing himself in the legal battle with Santander bank over a property in Ballymena, Co Antrim.
At the end of the hearing he allegedly got up and moved towards the bench, claiming he was going to arrest the judge.
Security and court staff intervened before he was led from the courtroom.
Amid a heavy police presence, Mr Carlin was brought back later to hear an assessment of his behaviour and be told the potential consequences.
Flanked by two other officers, the policeman asked for a pen and paper to take notes of what was to be said.
As he started to interrupt proceedings, Lord Justice Gillen warned that any further outburst would see him arrested and removed from the court.
The judge stressed that he had allowed him several hours to reflect and consider his position.
Setting out his powers to impose a fine or commit to prison for any contempt of court, he told Mr Carlin he was being granted legal aid to try to secure a lawyer.
Lord Justice Gillen then confirmed: "I consider the events that occurred this morning amount, prima facie, to contempt in the face of the court.
"They include, without justification, interrupting the proceedings, refusing to resume your seat or to stop talking when requested."
He added that Mr Carlin had allegedly "approached the presiding judge in a threatening manner".
Lord Justice Gillen continued by telling him he abused his position as a police officer "in threatening to arrest one of Her Majesty's judges without lawful excuse" and physically interfering with a court tipstaff.
"You will have an opportunity, with the benefit of legal representation, to apologise to the Court and provide an explanation for your behaviour."
The case was listed for a further hearing later this week.
Mr Carlin was escorted back out of the courtroom by uniformed officers.
A PSNI spokesman confirmed later: "A 43-year-old man was arrested on suspicion of two counts of common assault at the Royal Courts of Justice in Belfast this morning.
"He remains in custody at Musgrave police station. The matter has been referred to the Police Ombudsman."