A Las Vegas judge who last month ordered a public defender to be placed in handcuffs in court, saying she needed to learn "a lesson" about courtroom etiquette, got a lesson of his own when he lost his seat in Tuesday's primary election in Nevada.

In the race for Las Vegas Justice of the Peace, incumbent Conrad Hafen lost by a landslide to criminal defense attorney and former prosecutor Amy Chelini. With 100 percent of precincts reporting, Chelini defeated Hafen resoundingly, 62 percent to 24 percent (53,332 votes to 21,274 votes).

The election came just weeks after Hafen faced sharp criticism for placing Clark County Deputy Public Defender Zohra Bakhtary in handcuffs as she defended a client who faced jail for violating probation.

As Bakhtary tried to speak, Hafen told her to "be quiet" and then ordered a court marshal to handcuff Bakhtary and seat her in the jury box next to inmates. Hafen then sentenced Bakhtary's client to six months in jail.

"Clearly Zohra was acting within the bounds of her constitutionally mandated role as an advocate for her client when Judge Hafen had her placed in handcuffs," Ryan Bashor, president of the Clark County Defenders Union, told The Huffington Post in an email. "The voters overwhelmingly expressed their disapproval of the Judge’s actions."

Hafen did not immediately respond to a request for comment.

Shortly after the handcuffing incident, a group of Nevada defense attorneys called for sanctions against Hafen, saying he has a “complete disregard for the law” and that he "demeaned and humiliated" Bakhtary in court. The Clark County Defenders Union, which represents about 100 public defenders in the county, including Bakhtary, also denounced Hafen's actions, calling them “unreasonable and unprecedented.”

Bakhtary told HuffPost last month that the judge’s actions were "extremely offensive" and that she never behaved unprofessionally in his courtroom, but was simply trying to do her job.

About a week after handcuffing Bakhtary, Hafen filed a contempt order against her, one that Bakhtary is currently fighting with her attorney Dominic Gentile.

"This judge came off looking unjudicial, undisciplined and unprofessional," Ken White, a criminal defense attorney in Los Angeles and a leading voice on legal issues on the law-oriented blog Popehat, told HuffPost. "Some judges -- this may be one -- have more of a hair trigger when a woman interrupts them than a man. Certainly judges have more of a hair trigger when a defense attorney interrupts them."

"It seems like an overreaction by a judge not in control of his temper," White continued. "Not unusual, but regrettable."

Still, White was surprised that Hafen lost in this week's primary.

"I’m surprised whenever a judge faces electoral consequences for being unprofessional toward defendants or defendants' lawyers," White said. "Usually the public supports that."