SEVEN VALLEYS, Pa. (AP) — State Police say troopers from the York barracks fatally shot a man who threatened them with a knife.

A spokesman says the shooting happened at about 1 a.m. Saturday in York County’s Springfield Township. The unidentified 40-year-old man had reportedly struck several cars and a telephone pole outside of an apartment complex. Authorities say the man was cutting himself with an 8-inch folding knife and he refused to listen to police commands.

The troopers tried to subdue the man with pepper spray and stun guns but were unsuccessful. The man then allegedly turned on the troopers and advanced toward them, and was fatally shot.

State Police, the York County District Attorney and the County Coroner are investigating and toxicology tests on the man are pending. The troopers weren’t hurt.

(Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)