After more than three years of legal wrangling, the trial of a Biddeford landlord accused of fatally shooting two teenagers and wounding a woman has been scheduled to begin Feb. 22.

The trial date for 77-year-old James Pak was set Wednesday after his attorneys and a prosecutor came to an agreement on whether a recorded police interview of the defendant will be used as evidence.

The development comes as Susan Johnson, who survived the shooting on Dec. 29, 2012, marked its third anniversary. Police say Pak first shot Johnson, now 47, then shot and killed her 19-year-old son, Derrick Thompson, and her son’s girlfriend, 18-year-old Alivia Welch, in an apartment he owned.

“This is a very emotional time of year for my family, with yet another Christmas without my son and the third year anniversary of losing him,” Johnson said in an email. “The trial for me will be a piece of closure to this nightmare/tragedy. With that being said, I’m very pleased with finally having a trial date set.”

Setting the trial took longer than it would in most cases, mainly because attorneys in York County Superior Court in Alfred raised questions about Pak’s mental competence. Pak had initially entered not guilty pleas to two counts of murder and one count of attempted murder, then changed his plea in June 2014 to not guilty by reason of insanity.

Pak’s attorneys, Joel Vincent and Lawrence Goodglass, then argued further in 2014 and this year that Pak’s diminished memory makes him unfit to be tried for murder.

But Justice John O’Neil Jr. considered testimony from three psychologists who examined Pak and issued a ruling in November that Pak is competent to stand trial.

O’Neil wrote in his ruling that he was persuaded against the defense attorneys’ argument by the testimony of Robert Riley, a psychologist who examined Pak twice in 2014. Riley found that Pak understood the seriousness of the charges against him and could participate in his own legal defense.

With that ruling, the lawyers and the prosecutor, Assistant Attorney General Leane Zainea, had only one remaining dispute: whether the state could use a recorded interview by police of Pak after his arrest on the day of the shooting. Pak has been held in custody since then.

“We had reached an agreement,” Zainea said by phone on Thursday. “We’re not going to use the interview in our case in chief, but if (Pak) testifies we may use it to impeach him based on prior statements.”

Vincent and Goodglass have not indicated whether Pak would testify at the trial.

The shooting at the apartment, part of Pak’s house at 17 Sokokis Road, came under particular scrutiny because police had been called to the apartment earlier that day. They left after deciding the dispute was under control, just minutes before Pak allegedly shot the three.

Court documents say Pak waited for police to leave, got a gun, opened the door to the apartment and said: “I am going to shoot you. I am going to shoot you all.”

The two teenagers were dead by the time emergency responders arrived. Johnson has since recovered from her injuries.