MANCHESTER, N.H. — A man charged with shooting and wounding two New Hampshire police officers last year is changing his plea to not guilty by reason of insanity.

Ian MacPherson previously pleaded not guilty to attempted murder and first-degree assault. Court officials said Tuesday a plea and sentence hearing has been set for Feb. 8. On Wednesday, they said the parties have agreed to enter the new plea.

MacPherson is accused of shooting Manchester officers Ryan Hardy and Matthew O’Connor in May 2016, while they were chasing him because he matched the description of a suspect in a gas station armed robbery. Hardy was shot in the face and torso; O’Connor was treated for a gunshot wound to the leg.