A Waukegan police officer shot a man who approached him and pointed what appeared to be a handgun at him while he was sitting in his police car.

Authorities said that at 5 p.m. on Tuesday a Waukegan police officer was sitting in his squad car on the west side of the police department on North West Street when he was approached by a male suspect in his 20s.

“The suspect immediately threatened the officer with, what appeared to be, a black semi-automatic handgun. The officer shot the suspect,” the Waukegan Police Department said.

Police said that the black semi-automatic handgun turned out to be a BB gun.

The suspect was transported to an area hospital with non-life-threatening injuries. The officer was also taken to an area hospital for precautionary measures where he was treated and released, officials said.

The incident is under investigation by the Illinois State Police.