A judge criticized by First Amendment experts for restricting media coverage of a Standish attorney’s domestic assault case admitted Wednesday that he made a mistake.

Judge Jeffrey Moskowitz appeared in a courtroom at the Cumberland County Courthouse in Portland and issued the apology before a crowd of about 35 people, mostly media members and curious lawyers.

“It is certainly very clear to me that this particular order was not lawful, and I should not have ordered the media to refrain from reporting what was said,” Moskowitz said. “That order is now rescinded.”

On Monday, Moskowitz had told members of the media that they were forbidden to report any witness testimony or anything said in court by the defendant, attorney Anthony J. Sineni III.

The Portland Press Herald defied the gag order Tuesday, publishing a story about the hearing that included testimony from Sineni’s ex-girlfriend, with whom he has two children and custody of a third child that she had from a previous relationship.

The newspaper’s attorney, Sigmund Schutz, said Monday evening that there is a “100 percent chance” that the judge’s order was unlawful. Other First Amendment experts followed Tuesday, decrying the order as a clear constitutional violation.

Moskowitz also received attention from national media outlets, including a segment Tuesday on “The Rachel Maddow Show” in which Maddow called the Press Herald’s defiance of the gag order “a one-fingered First Amendment salute.”

“We’re gratified that Judge Moskowitz rescinded an order that was clearly unconstitutional. We defied the order in the first place because it was a clear violation of the First Amendment, which we will continue to defend vigorously,” Steve Greenlee, the Press Herald’s managing editor, said after attending Wednesday’s hearing.

Monday’s session was a plea hearing and sentencing, during which Sineni did not admit any wrongdoing but acknowledged there was enough evidence to find him guilty on charges of assault and disorderly conduct.

In exchange for the plea, one misdemeanor count of domestic violence assault was dismissed against Sineni involving his ex-girlfriend, along with three felony counts of witness tampering and a felony count of possession of a stolen gun or guns.

Moskowitz sentenced Sineni to what is called a deferred disposition on the assault charge and the disorderly conduct charge. After one year, the disorderly conduct charge could be dismissed if Sineni stays out of trouble. After two years, the assault charge could be dismissed.

Winona Hichborn, Sineni’s 34-year-old ex-girlfriend, was the only witness who spoke during Monday’s court hearing. It was her testimony, in which she described her 11-year relationship with Sineni and claims of domestic abuse, that the judge ordered the media not to report.

“Tony (Sineni) told me before that he is above the law and that if he gets away with this they won’t be able to touch him,” Hichborn testified Monday.

The domestic assault charge against Sineni that was dismissed was for allegedly striking Hichborn. The assault charge for which Sineni was sentenced was for allegedly striking Hichborn’s male friend, Amer Radhi. Sineni’s attorney, Christopher Largay, contends that Sineni and Rahdi were fighting on Sept. 19 when Hichborn fell and hit her eye on a table after she stepped between them.

After Wednesday’s hearing, Largay said Sineni had sought only to have Hichborn blocked from testifying at his sentencing hearing, and that he did not intend the media to be restricted.

“I never tried to exclude the press. I believe in the freedom of the press. My client believes in the freedom of the press,” Largay said.

He said he had drafted a motion to exclude Hichborn and her representatives from Monday’s hearing, but never filed it. Since the charge in which she was named as a victim was being dismissed, she should not have been allowed to speak, he said.

“In April to August 2014, just prior to these charges, Mr. Sineni was granted sole parental rights and responsibility of his two children and of the third child who is not his own biological child,” Largay said.

He said Hichborn filed a criminal complaint against Sineni in “retaliation” and to regain custody of her children. Sineni had been unable to see the children while the case was pending, and will be able to now that it’s resolved.

Moskowitz reached the decision to issue the gag order on the media during a meeting with Largay and Assistant Attorney General Paul Rucha in the judge’s chambers before Monday’s hearing, Largay said.

Largay denied that he or Rucha suggested the gag order, while also denying that the judge reached the decision on his own. He said the meeting in the judge’s chambers was heated, and Largay was unable to account entirely for what happened.

During Wednesday’s hearing, Moskowitz also rescinded a second order he had issued Monday to seal Sineni’s case file for seven days at Largay’s request.

Moskowitz said Wednesday that both orders were “clearly mistakes” and ruled that a transcript of Monday’s hearing should be created from an audio recording and added to Sineni’s now-public case file.

Sally Bourget, head clerk at the courthouse, said the transcript from Monday’s hearing will likely be completed by Thursday or Friday.