LOCKPORT – A former Lutheran school music teacher convicted in 2005 of having sex with an underage girl over several years will get a new trial because of errors by the judge and his defense attorney.

The State Court of Appeals ruled unanimously last week that a conflict of interest existed for Michael J. Solomon’s lawyer, because she was representing, in a civil matter, the police officer who testified that Solomon had confessed to the sex crimes against the girl. That conflict wasn’t adequately waived, the state’s highest court said.

The ruling cancels the 32-year prison sentence imposed by then-Niagara County Judge Peter L. Broderick Sr. A jury convicted Solomon of 23 counts, including rape, criminal sexual act, course of sexual conduct against a child and use of a child in a sexual performance. The latter charge resulted from taking pornographic photos of the girl, who was between the ages of 10 and 14 when Solomon was having sex with her.

Solomon, who turns 48 Friday, wouldn’t have been eligible for parole until 2033.

Solomon taught drums and trumpet for 11 years at Matt’s Music in North Tonawanda and also taught at two Lutheran schools, Holy Ghost in Wheatfield and St. John in North Tonawanda. The victim was not one of his students.

The new trial was ordered even though the strength of the evidence against Solomon was not questioned and even though the Court of Appeals acknowledged that defense attorney Michele G. Bergevin had done a good job cross-examining Detective Larry Kuebler of the North Tonawanda Police Department, her client in the civil case.

“The Court of Appeals now says in a situation like this, [Solomon] doesn’t have to prove prejudice. It’s an automatic reversal,” Niagara County Assistant District Attorney Thomas H. Brandt said.

“I thought it was inevitable. They really had to reverse,” said Mark J. Mahoney, the Buffalo lawyer who argued Solomon’s appeal. “It was a serious violation of a well-established rule about what the judge is supposed to do when a defense attorney has a conflict of interest.”

According to the Court of Appeals ruling, Solomon told Kuebler and Detective Karen Smith that he had sex with the girl once. A hearing was held to determine whether that statement was admissible.

On the day of the hearing, Bergevin told Broderick in court about her conflict of interest regarding Kuebler. She said she told Solomon about the situation, and Solomon “has agreed to waive any conflict in that regard.”

“Is that correct, Mr. Solomon?” Broderick asked.

“Yes, sir,” the defendant answered.

Nothing more was said about it, and the Appellate Division of State Supreme Court upheld the conviction in 2010, finding that even though the waiver of the conflict was inadequate, Solomon didn’t show that it harmed his defense.

But the Court of Appeals ruled that Broderick should have taken more time to discuss with Solomon, on the record, the risks involved in having a lawyer who was simultaneously representing a prosecution witness in another case.

“The court rule is such that it does put the burden on the judge,” Mahoney said. “There’s no way a defense attorney should have taken on a police officer witness as a client without thoroughly going over it with the [defendant] and spreading on the record the reasons why this was not a problem.”

Bergevin declined to comment on the ruling. Mahoney said there is a possibility he will represent Solomon in the retrial, but that hasn’t been settled.