A thief breaking into a car was stopped by a gun-toting judge.

Police say Eddy County Magistrate Judge Kelly Calicoat caught the man in the parking lot behind the courthouse breaking into a car, and held him until officers arrived.

A criminal complaint says he walked out the back of the courthouse to see 40-year-old Carlos Quintana rummaging through the car, which belonged to a clerk there.

He told officers he then went back in and asked the clerk if anybody was supposed to be inside her car. She replied, “no.”

When he went back outside to confront the suspect with the clerk, he believed Quintana was acting strangely, so he drew his gun and told him to get on his knees and stay there until police arrived.

Calicoat is a retired Eddy County sheriff’s detective and spent nearly 30 years there, something he campaigned on last year.

“Twenty-eight years in law enforcement. Honest, dedicated. Wonderful family, and most of all, Calicoat is justice for all,” said supporter Lucy Yanez in a video endorsing him.

Calicoat told officers he couldn’t see if Quintana was hiding a weapon under his baggy clothes.

Quintana told Calicoat he had just gotten out of jail and thought the clerk’s car was his. He’s still behind bars.

Calicoat has been the magistrate judge in Carlsbad since last July. KRQE News 13 reached out to him for an interview, but he was unable to comment due to his job.

According to online court records, Quintana has been arrested for burglary, car theft and armed robbery in the past.