Police in Pennsylvania said an officer was forced to shoot a teenager Monday after he came at them wielding an ax.

Cops arrived at the Upper Derby, Pa., home after receiving a 911 call around 1:17 a.m. local time from a 19-year-old who said he was going to kill himself and his family, myFOXphilly.com reported.

The suspect's mom then answered the front door with no clue why the officers were at her home, according to Supt. Michael Chitwood of the Upper Derby Police Department.

When police began searching the house, the unnamed male jumped out from a closet and began swinging an ax, striking one of the officers on the arm, police said.

The officer then fired two shots at the suspect, striking him.

The 19-year-old -- who has a history of mental illness -- was taken to the Hospital of the University of Pennsylvania and is listed in critical condition.

However, the officer struck by the ax is fine.

"[The suspect] was laying in ambush ... so it looks like it is suicide by cop," Chitwood added.