This article was edited at 10:30 a.m. to correct when Trevor MIlls died.

PORTLAND – The man accused of killing the mother of his four children and his longtime friend in New Gloucester this summer pleaded not guilty to murder charges Thursday in Cumberland County Superior Court.

Joel Hayden, 29, is accused of shooting 27-year-old Renee Sandora of New Gloucester and 28-year-old Trevor Mills of New Bedford, Mass., outside Sandora’s home on July 25. Both victims died the following day.

The eldest child of Hayden and Sandora, a 7-year-old, witnessed the shootings outside the mobile home on Bennett Road, according to a police affidavit. The child told a Maine State Police detective that his parents had been arguing before Hayden pushed Mills through a door and fired at him and Sandora, the document said.

According to the affidavit, Sandora’s parents said their daughter and Hayden had been arguing constantly since June and that Hayden had accused her of having a relationship with Mills. The parents said she had kicked Hayden out of the house more than once, but he had returned later, according to the affidavit.

During his arraignment Thursday, Hayden said nothing except to answer “not guilty” to each of the two charges read by Justice Nancy Mills. Murder carries a sentence of 25 years to life in prison.

Hayden was captured after a police pursuit that ended when he crashed his car in Lyman. His back was seriously injured in the crash, but Thursday he was no longer wearing the brace he had worn during his initial court appearance in July.

Assistant Attorney General Lisa Marchese and John Ney, Hayden’s court-appointed lawyer, agreed on a Jan. 3 deadline for motions in the case. The same deadline will apply for a bail hearing. Hayden is being held without bail at Cumberland County Jail.

Hayden’s hands were handcuffed in front of him, and he used them to shield his face from television and still cameras in the courtroom. After the proceeding ended, he made an obscene gesture toward a news photographer. As he was led out of the courtroom, he told Sandora’s family, “Tell my kids I love them.”

Mindy Dube of Auburn, who said she had been dating Mills for several months before he was killed, was among the friends and family in court wearing T-shirts with images of the two victims.

Mills and Hayden had been friends since childhood, and Mills had not seemed concerned about his relationship with Hayden, Dube said. She said she had met Hayden for the first time the day before the shootings.

“He actually didn’t want me to meet (Hayden) because he didn’t think I would like him,” Dube said after the arraignment. “He told (Hayden) if he met me he had to be on his best behavior.”

Staff Writer Ann S. Kim can be contacted at 791-6383 or at: [email protected]