Updated

A man charged with shooting and wounding two New Hampshire police officers has pleaded not guilty by reason of insanity and will serve five years in a state psychiatric unit.

Ian MacPherson previously pleaded not guilty to attempted murder and assault but changed his plea.

WMUR-TV reported Thursday that Rockingham County Superior Court Judge Andrew Schulman ordered MacPherson to serve five years in a state prison psychiatric unit.

MacPherson was accused of shooting Manchester officers Ryan Hardy and Matthew O'Connor in May 2016 after they tried to question him 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. Both officers have returned to work.

___

This story has been corrected to show the shooting happened in 2016, not last year.