Defense Attorney Susan Church said she was "astonished" when Boston Municipal Court Judge Richard Sinnott held her in contempt of court and took her into custody on Wednesday.

Church was representing a counter-protester charged with disorderly conduct after this weekend’s so-called "Straight Pride" parade in Boston. She said Sinnott's decision to hold her in contempt came after she tried to read case law arguing that the judge did not have authority to reject District Attorney Rachel Rollins' decision not to pursue charges against many of those who were arrested during the parade’s aftermath.

“[Sinnott's] position is that I interrupted him after being told not to,” Church told Jim Braude on Greater Boston, just a few hours after she was released Wednesday. “But I interrupted him because he wouldn’t let me speak. … I just wanted to read this one case to him.”

“I literally was handcuffed and brought to the lockup downstairs as I was explaining to [the judge] there’s a case exactly in point that is binding precedent that he must follow if he’s a judge that follows the law,” Church said.

On Wednesday evening, Rollins filed an emergency petition in court to protest Sinnott's arraignment of the protester and his decision to hold Church in contempt.

Earlier Wednesday, Sinnott declined to comment to WGBH News.

Church, who said she has represented protesters in court for 20 years, also raised questions about the judge’s motivation, both for holding her in contempt and refusing to allow charges to be dropped against several of those who appeared before him.

"I don’t think I’ve ever represented protesters who’ve been convicted. Their charges get dismissed," Church said. "And why is the judge so resistant to this? Is it because Rachael Rollins is the district attorney? Is it because he’s opposed to her political view of the way she prosecutes?"

A day earlier, Rollins had instructed prosecutors not to pursue charges against the counter-protesters who were charged with lower-level, non-violent offenses ranging from disorderly conduct to resisting arrest — a decision consistent with the promise Rollins made during her election campaign to focus on higher-level prosecutions.

After Church was taken into custody on Wednesday, Sinnott agreed to dismiss charges in many of the remaining counter-protester’s cases.

Judge Nancy Gertner told Greater Boston that she believed Sinnott overstepped his authority in refusing to drop charges against Church’s client. Gertner said that judges legally must comply with requests of nolle prosequi, or nol. pros., a legal term describing when a prosecutor declines to press charges.

“The judge has no authority under the law to refuse a nol. pros. — which is the prosecutor essentially wiping out the charges — and he has no authority to deny a motion to dismiss,” Gertner said.

“He can’t prosecute the case if the prosecutor doesn’t choose to,” she continued.

Former federal prosecutor Brad Bailey added that he was troubled by Sinnott’s decision to hold Church in contempt.

“She’s a highly respected attorney, and attorneys ought to have leeway to argue and advocate for their clients,” he said.

Gertner criticized Sinnott's handling of the situation as “lawless from beginning to end.”