BANGOR, Maine — The Maine Supreme Judicial Court was asked Wednesday to overturn the sentence of an Eddington man serving a four-year prison term for reckless violation of a protection order and misdemeanor assault on his estranged wife more than two years ago.

Portland lawyer Darrick Banda argued that Superior Court Justice William Anderson illegally relied on conduct Ryan Witmer, 34, was acquitted of after a jury trial. The sentence was imposed on Dec. 29.

Susan Pope, assistant district attorney for Penobscot County, who is handling the appeal, disagreed. She told justices Wednesday that Anderson relied on Witmer’s own testimony during the trial to fashion a sentence justified by the defendant’s actions, which included kicking in a locked door from the garage to the house.

She also noted that the sentence was less than the maximum sentence of five years for a Class C crime.

Story continues below advertisement.

A Penobscot County jury on Nov. 2 found Witmer, who had no previous criminal record, not guilty of aggravated attempted murder, elevated aggravated assault, aggravated assault and burglary after a 5½-day trial. Witmer was accused of breaking into the Orrington home he previously had shared with his then-estranged wife and attacking her and her boyfriend late on the evening of June 28, 2008.

The boyfriend, who has a black belt in tae kwan do, a Korean self-defense art, suffered 11 stab wounds in his back. Witmer’s wife, who had taken out a protection order to keep him away from her, suffered superficial cuts to her forearms, according to court documents.

The justices on Wednesday focused their questions and comments on the language that Anderson used when he imposed the sentence and the defendant’s actions.

“Mr. Banda, you’re saying the trial judge had to ignore reality to fashion a sentence,” said Justice Donald Alexander, a former Superior Court judge. “The trial judge looked at the facts that resulted in the conviction. This was a serious case based on those facts.”

Banda replied that Anderson used his client’s conduct, which the attorney said the jury found was legally justified — defending himself against a man who was a martial arts expert — as a basis for the sentence.

“The trial judge made it very clear that he was not disagreeing with the jury’s decision,” said Chief Justice Leigh Saufley, who also was a Superior Court judge before being appointed to the Supreme Court. “He focused on the violation, which was done in one of the most egregious ways it could occur.”

Justice Andrew Mead, another former Superior Court justice, also pointed out that Anderson did not say he disagreed with the jury at Witmer’s sentencing.

“The judge considered all the objective facts at sentencing,” Pope told the court. “Those facts were brought forth almost entirely by the defendant’s own testimony. Under Maine law, he could rely on all those objective facts at sentencing.”

Witmer’s ex-wife and the man she was with the night Witmer broke into the house and other spectators Wednesday rose to their feet and applauded when the time for Pope’s presentation expired.

Although Saufley did not admonish them immediately, a few minutes later as the session recessed, she asked the gallery to remain quiet as the justices left the courtroom.

There is no timetable under which the court must issue a decision.

In an unrelated case, Witmer is scheduled to go on trial next month in Penobscot County on one count of Class B theft by unauthorized taking. He pleaded not guilty in May to taking more than $35,000 from the Bangor mortgage company he ran with a partner.