Police in Maryland said they caught the man accused of trying to murder an officer by shooting him in the face Friday morning.

The officer was flown to a hospital in stable condition and will need eye surgery, police said. They did not identify the officer, but said he was a 10-year veteran with the Aberdeen Police Department.

Police say the suspect, 21-year-old Tyler Scott Testerman, is in custody in connection with the shooting. He was wanted for attempted murder, according to Sgt. C. William Reiber.

The officer was responding to a call for suspicious activity in a wooded area when the shooting took place, police said on Facebook. As many as eight projectiles hit him in the face, Fox 45 reports.

Schools in the Aberdeen area were closed for the day because of the search for Testerman.

Click for more from Fox 45.

The Associated Press contributed to this report.