MANCHESTER, N.H. (AP) – A man accused of shooting two police officers, one in the face and torso and the other in the leg, is facing two counts of attempted capital murder.

Ian MacPherson was arrested early Friday after a three-hour pursuit that left Manchester, the state’s largest city, on edge for hours more. He shot Officers Ryan Hardy and Matthew O’Connor, authorities said. Hardy was hospitalized in stable condition, and O’Connor has returned home.

Hardy stopped MacPherson on the city’s West Side around 2 a.m. because he matched the description of a suspect in a gas station robbery the day before, police Chief Nick Willard said. MacPherson began to shoot at Hardy as soon as the officer announced himself, striking him in the face and torso, police said.

After being shot, Hardy called in MacPherson’s description and the direction in which he ran, Willard said.

“Officer Hardy’s reaction to being shot is beyond courageous, it’s remarkable,” Willard told said Friday afternoon in an emotional news conference.

About 20 minutes later, MacPherson encountered O’Connor and shot him in the leg before fleeing. O’Connor returned fire, Willard said, but MacPherson was not shot or wounded during his encounter with police.

Willard did not provide details on how and where MacPherson was caught or what type of weapon he used in the shooting. He praised all of the officers involved for their pursuit of MacPherson.

“They continued at their own peril to pursue a subject who shot two officers,” he said. “I cannot express deeply enough my profound respect.”

MacPherson, who couldn’t be reached for comment by telephone, likely will be arraigned Monday. No bail had been set.

Despite the early morning apprehension, there was a visible police presence on the city’s West Side for much of Friday morning, with police helicopters flying. Residents were ordered to shelter in place, and several schools shut down for the day.

Mayor Ted Gatsas, a Republican, said the city is safe and there is no remaining danger to the public.

Manchester’s West Side includes a mix of older homes converted into apartments and small businesses. People who live near the site of the shootings described an active police presence through much of the morning that began immediately after shots rang out.

Edward Villmore, who lives near the site of the first shooting, said he awoke to multiple gunshots around 2 a.m. and heard an immediate police response.

“Next thing you know there’s sirens and tires squealing,” he said.

Villmore said he eventually went back to sleep and was surprised to still see a police presence in the neighborhood when he woke up around 10 a.m.

Floyd Johnson, who lives near the site of the second shooting, described a similar scene of waking up to gunshots and immediately hearing police swarm into the area. Johnson said he told his 13-year-old son to get on the floor. Police also told Johnson to stay put, away from the windows.