Federal prosecutors have charged former Charles County Circuit Court judge Robert C. Nalley — who once deflated the tire of courthouse cleaning woman — with violating the civil rights of a defendant by ordering a sheriff’s deputy to administer an electrical shock to the man inside his ­courtroom.

The deputy pressed a button that sent a 50,000-volt electrical charge to the Stun-Cuff attached to the ankle of the defendant, Delvon L. King, 25. King screamed and immediately dropped to the floor, according to witnesses and a court transcript.

Prosecutors last month charged Nalley with deprivation of rights under color of law, a misdemeanor. The charge came through a criminal information rather than a grand jury indictment. Such a move often signals that the defendant has agreed to plead guilty.

The charge against Nalley carries a maximum penalty of one year in prison and a $100,000 fine. Nalley’s criminal defense attorney, Robert C. Bonsib, declined to comment. Nalley, 72, did not respond to a phone message.

Nalley, who is scheduled to appear in U.S. District Court in Greenbelt on Monday, retired in 2013, but at the time of the incident had been given permission by the Court of Appeals of Maryland to continue to serve on a part-time basis.

On July 23, 2014, Nalley was presiding over jury selection in a case involving King, who was charged with three gun offenses in connection with a November 2013 traffic stop in Waldorf. According to court papers, King, a passenger in the car, was carrying a loaded handgun.

Prospective jurors had not yet been brought into the courtroom when King, who was acting as his own attorney, tried to assert what he believed was a legal argument and cited “principles of common right and common reason,” according to a court transcript. (King considered himself a “sovereign citizen” and did not believe the government’s laws applied to him.)

“Stop,” Nalley said. King continued speaking, according to the transcript.

Nalley ordered Charles County Deputy Sheriff Charles P. Deehan to shock King.

“Do it,” Nalley told the deputy. “Use it.”

Twice, Deehan pushed a button to administer an electrical shock to King’s ankle, to no effect, the deputy later told a sheriff’s investigator. Deehan “hit the button a third time and King went down to the ground,” according to the sheriff’s report by Sgt. Patti Garino, which was obtained through a Maryland public records request.

The court transcript described King’s reaction: “(DEFENDANT SCREAMS).”

Authorities summoned paramedics, who examined King and determined he was not seriously injured, according to Garino’s report. Nalley then proceeded with the case and a jury convicted King of the gun charges.

King then agreed to let Michael Beach, the chief public defender in Charles County, represent him. Beach filed a motion for a new trial, asserting that King’s rights to a fair trial were violated because the sheriff’s office outfitted him with a Stun-Cuff without a judicial hearing, and that the use of the Stun-Cuff limited his ability to represent himself because he was in fear of being electrocuted again.

In November 2014, prosecutors and Beach resolved King’s gun charges with a probation before judgment agreement, in which the defendant avoids a criminal conviction if he abides by conditions imposed by the court. The agreement called for King to spend two years in jail, most of which he had already served, and Beach withdrew the motion for a new trial.

As part of her investigation, Garino took statements from a dozen witnesses, including Nalley, according to her report.

Nalley told Garino that King was citing case law that was irrelevant. When he asked both sides whether they had any questions for prospective jurors, King was “rude” and “non-responsive,” ­Nalley told Garino.

King was “preventing us from the court proceeding,” Nalley told Garino, explaining why he ordered Deehan to shock the defendant. After Deehan administered the shock, King returned and behaved appropriately, Nalley said.

King’s case was originally not assigned to Nalley, but to Circuit Court Judge Amy J. Bragunier, the chief administrative judge in Charles County Circuit Court. On the day of the incident, King appeared before Bragunier for jury selection. Bragunier told Garino that King was “belligerent” and was speaking over her, according to Garino’s report. She directed a court security officer to take King to Nalley for jury selection and to “Let Judge Nalley know he is acting up.”

In a statement last week, the sheriff’s office said deputies made the decision to outfit King with a Stun-Cuff because he had allegedly fled from a prior court hearing. A court security supervisor advised Nalley that King was wearing the device, and the judge did not object.

The statement noted that Deehan has undergone additional training.

About a month after the incident became public, in September 2014, the Court of Appeals of Maryland, the state’s highest court, banned Nalley from the bench. The court did not state why, but said it had found “good cause” to take the action.

The alleged civil rights violation is not the first crime Nalley has been charged with.

On Aug. 10, 2009, Nalley deflated the tire of a 2004 Toyota Corolla that was parked in a restricted area near the La Plata courthouse. Charles County sheriff’s deputies witnessed the incident, and one of them recorded it. The judge placed a pen or other sharp instrument into the tire’s valve to release the air. Nalley considered the spot his; it turned out the car belonged to a woman on the courthouse cleaning crew who parked there because she did not want to walk through the courthouse parking lot at night.

Two months later, Nalley pleaded guilty to tampering with a motor vehicle, a misdemeanor. A district court judge ordered Nalley to pay a $500 fine and write a “heartfelt” letter of apology to the ­woman.