Judge Joseph Claps kept his sunglasses on as he paced the courthouse lobby, but his suit jacket was off, folded and draped over his prohibited firearm.

He is a friendly guy, at least according to a surveillance video inside Chicago’s Leighton Criminal Court Building, which shows Claps waving at two women passing by. It was about lunchtime on July 3, hours before a holiday.

Then a silver-toned pistol tumbles from a fold in his coat and slides across the polished floor.

There is no audio in the video released by authorities, but the sound undoubtedly makes an impression. The women, one of them a sheriff’s deputy, pivot toward the metallic clank. Another deputy nearby whips her neck around to see what happened.

Now Claps, 70, an associate judge in Cook County’s circuit court, has been charged with a misdemeanor crime of carrying a firearm in a prohibited place, authorities said.

Claps’s pistol was loaded when he dropped it, Cook County Sheriff’s Office chief policy officer Cara Smith told The Washington Post on Wednesday.

The judge holds a gun owner identification card and a valid concealed carrying license, but that does not supersede the state law banning firearms in such places as courthouses, she said.

Judges, deputies and other courthouse workers come in the building without stepping through metal detectors, she said. Claps was walking toward the court when the incident occurred, an official familiar with the incident said.

There was a question on whether judges were exempt from that regulation, which may have led to initial restraint from the deputies on scene, Smith said.

Perhaps he had an exemption because of a threat or some other circumstance. After all, her office had never encountered potential violations of the prohibition, she said. The deputies notified their supervisors to investigate.

But the office of Chief Judge Timothy Evans told the sheriffs no exemption or authorization to carry firearms was made for Claps, she said. He was processed and charged Friday but was not detained, Smith said. She thinks the charge carries a maximum of 60 days in jail and a $150 fine.

Claps did not immediately return a message seeking comment. He was reassigned to “nonjudicial duties” pending a Wednesday meeting of 17 judges of the circuit court, chaired by Evans, spokesman Pat Milhizer said in a statement to The Post.

His court date is July 19. Robert Foley, a spokesman for the Cook County State’s Attorney’s Office, told The Post the case was referred to the Illinois attorney general to avoid conflicts of interest between Claps and prosecutors who have worked cases before him.

Claps has been a judge for more than two decades, the Chicago Tribune reported, including work as a Cook County prosecutor and top assistant to the state attorney general.

Read more:

An FBI agent did a backflip in a club, dropped his gun and accidentally shot someone, police say

Anti-gun violence protesters take over Chicago highway

A man confronted a teenage neighbor over early morning fireworks — then shot him to death, police say