A well-known criminal defense attorney was convicted of two misdemeanor charges Monday as part of a plea agreement in which five other charges, mostly felonies in what started as a domestic violence case, were dismissed.

Anthony J. Sineni III, 52, of Standish sought to restrict media coverage of the case against him in the Cumberland County Courthouse in Portland and persuaded a judge to order the media not to report what he or any witnesses said in court.

Judge Jeffrey Moskowitz, the deputy chief of the state’s district court, told members of the media as the hearing began what they could and could not report.

A reporter for the Portland Press Herald protested the order and asked for time to contact legal counsel. Moskowitz denied the request and said the hearing would proceed without delay, declaring that anyone who did not agree to comply with his order to report only what the prosecutor and Sineni’s attorney said would be ejected from the courtroom.

After the judge’s exchange with the media, Sineni entered a plea in which he didn’t admit any wrongdoing but acknowledged there was enough evidence to find him guilty to charges of assault and disorderly conduct.

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

Under the terms of the sentence, the disorderly conduct charge would be dismissed after one year and the assault charge would be dismissed after two years if Sineni stayed out of trouble.

Sineni said nothing during the hearing, letting his attorney, Christopher Largay, speak on his behalf. Sineni also declined to comment outside the courtroom.

An attorney for the Portland Press Herald, Sigmund Schutz, said Monday evening that the judge’s order to the media was a clear violation of the public’s First Amendment constitutional right of free speech.

“There is a 100 percent chance that the order is unlawful,” Schutz said. “I think there is no question that the U.S. Supreme Court and other courts have been very clear, what occurs or is said in the court is a matter of public record.”

Such orders restricting the media’s free speech are usually upheld only in cases of national security, such as in a wartime situation where numbers of troops or troop locations are in question, Schutz said.

The prosecutor, Assistant Attorney General Paul Rucha, declined to comment on the judge’s order to the media. He said that Sineni had persuaded the judge to order the case against him sealed from public dissemination.

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

The Portland Press Herald did not comply with the order after consulting with its attorney.

“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, flanked by her attorney and a victim-witness advocate.

Hichborn’s attorney, Elizabeth Peoples, represents her in a civil case against Sineni and spoke to the media outside the courthouse after a heated argument with Largay inside.

“This case has received special attention because he is a prominent attorney,” Peoples said, referring to the judge’s gag order to the media regarding her client’s testimony.

Largay said after the hearing that the assault charge and disorderly conduct charge against Sineni pertained to a male friend of Hichborn’s and not to her as an alleged victim.