A man stabbed and critically wounded a Butler City, PA, police officer, who then shot and killed him Tuesday morning.

Butler City police responded to a call about a man “acting erratically and jumping in and out of oncoming traffic,” a news release said.

“As soon as they encountered the male, a struggled ensued,” Pennsylvania State Police Trooper Josh Black said.

During the struggle with the man, the Butler City officer was stabbed multiple times, police said. The officer then fatally shot the man, WPXI reports.

The wounded officer was flown to a Pittsburgh hospital. He is reportedly in critical but stable condition.