An Aroostook County man admitted in court Wednesday to killing two people and wounding three others in a two-county rampage in 2015, according to the Maine attorney general’s office.

Anthony Lord, 37, of Crystal pleaded guilty Wednesday to two counts each of murder, attempted murder, elevated aggravated assault, theft of firearms and one count each of arson, aggravated assault and eluding an officer, according to his attorneys. A kidnapping charge and two counts of reckless conduct with a dangerous weapon were dismissed.

Wednesday’s hearing was held in at the Rockland courthouse because it is closer to the Maine State Prison, where Lord is serving a sentence for an assault unrelated to the rampage two years ago, defense attorneys said.

Lord told Superior Court Justice Ann Murray that he pleaded guilty to the charges because “it was morally right,” his attorney, Jeffrey Toothaker of Ellsworth, said after Wednesday’s hearing.

There is no plea agreement in the case, Assistant Attorney General Leane Zainea said Wednesday afternoon in an email.

Besides admitting to the murders of Kyle Hewitt, 22, of Benedicta and Kevin Tozier, 58, of Lee, Lord pleaded guilty to shooting and wounding Kim Irish, 57, Clayton McCarthy, 57, and Carlton Eddy, 52, all of Benedicta.

Lord also set fire to a barn, stole firearms from a Silver Ridge Township home and beat a man there after tying him to a chair.

Most of the crime spree occurred with police trying to catch up with Lord as he raced through several Aroostook and Penobscot county towns on July 16 and 17, 2015.

Many of Lord’s actions appear to be random, others were apparently displays of cold cunning, and Lord has never publicly explained what motivated him.

Lord burned a barn in Benedicta late July 16, stole weapons and committed the assault in Silver Ridge before returning to the fire scene in Benedicta early the next day. There, he wounded Irish and killed Hewitt as Hewitt slept on a couch in Irish’s home. He shot Eddy as Eddy went to the barn to see the damage done by the fire, and left Benedicta.

Lord was then in a high-speed chase with police in Medway, with Lord shooting at an officer. Lord evaded his pursuers and shot Tozier dead and wounded McCarthy in a woodlot in Lee while stealing a pulp truck — possibly a change in vehicles to confuse his pursuers.

Hours later, the manhunt ended when Lord surrendered at the home of an uncle in Houlton.

Lord, who has a long criminal history and is a lifetime registrant of the Maine Sex Offender Registry, faces between 25 years and life in prison on the murder charges alone. He is scheduled to be sentenced Aug. 7 in Bangor, Zainea said.

“The state will be seeking life sentences at the time of sentencing,” the prosecutor said.

Additional reporting by Nick Sambides Jr.