BANGOR, Maine — A local man found guilty of trying to murder his ex-girlfriend more than two years ago was sentenced Tuesday at the Penobscot Judicial Center to 18 years in prison with all but 13 suspended.

Superior Court Justice William Anderson also sentenced David Archer, 35, of Bangor to four years of probation.

In January, Archer was convicted by a jury of eight men and four women of stabbing his ex-girlfriend twice — once in the chest and once in the abdomen — on April 26, 2008, outside a Hudson Street apartment in Bangor. He took the stand in his own defense and testified that he did not remember stabbing the woman he had met at a methadone clinic in Bangor. Archer conceded he had been convinced by the evidence that he must have caused her injuries.

Archer said he threatened to kill her and her new boyfriend in front of his mother on the afternoon of the stabbing, but told the jury the threat was idle. According to testimony, however, one of the stab wounds lacerated the victim’s liver, and her physician said the injury could have been life-threatening had she not received treatment immediately.

Archer, the victim and other witnesses testified they had combined their prescribed doses of methadone with cocaine and other illegal drugs in the hours before the stabbing. The jury rejected the argument that Archer was not guilty because he was high on cocaine when the crime occurred and convicted him of attempted murder, elevated aggravated assault and aggravated assault.

“I wish I could go back and undo all this,” Archer said shortly before he was sentenced. “I’m sorry for what I did. I hope someday [the victim] will be able to forgive me for what I did.”

That statement of remorse, which Anderson said Tuesday he did not see from the defendant during his trial, was one of the reasons the judge cited for imposing the sentence he did.

“Mr. Archer is carrying himself differently [today] than he did during the trial,” the judge said. “I attribute that to his drug use. He was not as alert at trial as he is today.”

During his trial, Archer at times appeared to be dozing off.

Greg Campbell, assistant district attorney for Penobscot County, asked that Archer be sentenced to 22 years in prison without probation due to his long criminal record dating back to 1994. Defense attorney Stephen Smith of Bangor urged the judge to send Archer to prison for 15 years with all but eight suspended and four years of probation.

The now 24-year-old victim and her mother, who are not being identified by the Bangor Daily News, asked the judge to send Archer to prison for 30 years, the maximum sentence for a Class A crime.

The victim, who lives in Hampden with her parents and son, whose father is not Archer, told Anderson that her trust in people had been stripped away and she questioned her mortality on a daily basis.

“To this day my son asks if my [surgical] scars will ever go away and if the bad man is gone for good,” the mother of a nearly 5-year-old said. “I think you should sentence him to the maximum sentence because my prison sentence will never end.”

Smith said after the sentencing that he would appeal Archer’s conviction to the Maine Supreme Judicial Court.