BANGOR, Maine — Jurors late Monday afternoon found an Eddington man not guilty of trying to kill his estranged wife and her boyfriend 16 months ago.

After deliberating for two hours, the jury of four men and eight women found Ryan Witmer, 33, not guilty of aggravated attempted murder, elevated aggravated assault, aggravated assault and burglary. Jurors found him guilty of the lesser charges of simple assault on his ex-wife and violation of a protection from abuse order.

Witmer’s legal team argued during the 5½-day trial in Penobscot County Superior Court that although he should not have been at the house because of the protection from abuse order, he was defending himself when he stabbed his then-wife’s boyfriend 11 times in the back.

Superior Court Justice William Anderson released Witmer, who had been held without bail at the Penobscot County Jail since his arrest on June 29, 2008, on $20,000 surety bail. Witmer’s mother put up a surety on her Eddington home as bail. Witmer is expected to live with her.

Conditions of his release include no contact with his ex-wife and her boyfriend, no use of alcohol or drugs, and random testing for their use. Witmer also may not be at his former residence on Stone Wall Drive in Orrington.

Anderson said a sentencing date would be set later in the month.

Family members, who sat behind Witmer throughout the trial, wept as the verdict was announced. The defendant hugged his attorneys and, after the jury had left, his mother and other family members.

Reached by phone after the verdict, the ex-wife’s boyfriend said, “We cannot comment on that.”

“I’m disappointed,” Michael Roberts, the deputy district attorney for Penobscot County who prosecuted Witmer, said. “We put a lot of work into the case. It’s hard to pinpoint one item on which it might have turned.”

Portland defense lawyer Darrick Banda, who attended Bangor High School with Witmer, said the jury believed his client’s version of events. Banda assisted well-known criminal defense attorney Daniel Lilley of Portland during the trial. In his closing argument, Lilley told the jury that Witmer had violated the protection order by coming to the house and had assaulted his ex-wife.

“Ryan’s testimony was the only testimony that was consistent with the physical evidence, consistent with the 911 call and consistent with the photos taken at the scene,” Banda told reporters. “The jury had to figure out which one of these people to believe. Ryan admitted that he knew there was a protective order and took responsibility for putting his hands on [his ex-wife].”

Witmer’s ex-wife and the man who suffered the stab wounds in his back the night of June 28, 2008, now live together in the Orrington home Witmer once shared with her.

Witmer was accused of attacking his 37-year-old wife and her boyfriend — a 42-year-old high school teacher and part-time martial arts instructor she was seeing — late on the evening of June 28, 2008, while her three children were sleeping upstairs. The children, then ages 7 months to 9 years, were not injured.

The boyfriend, who has a black belt in tae kwan do, a Korean self-defense system, suffered 11 stab wounds to the back. Before both his lungs collapsed from the wounds, he managed to prevent Witmer from injuring his ex-wife more severely, according to police reports. Witmer’s ex-wife suffered cuts to her forearms, according to court documents.

The defendant, who was living with his parents in Eddington at the time, stabbed himself twice in the abdomen before drawing the knife under his own chin and slitting his throat, according to court documents.

The boyfriend and Witmer’s ex-wife testified that Witmer broke into the house and attacked the teacher with a knife when he tried to defend her. The boyfriend said that he did not realize Witmer had a knife until after he had been stabbed.

Witmer told the jury that he went to the house that night to see his then 7-month-old daughter because he had an overwhelming feeling that “something was wrong.” He testified that he pulled his knife out of his pants pocket and stabbed the martial arts teacher because he had him in a chokehold and Witmer was on the verge of passing out.

Witmer faces up to five years in prison on the violation of a protection order conviction because it included an assault and up to a year in jail on the assault conviction. He most likely will not be sentenced to additional jail time, according to Roberts and Lilley. A sentence could include some probation, both attorneys agreed.