A Pennsylvania police officer was stabbed and critically injured Tuesday while struggling with a man whom he ultimately fatally shot, according to state police officials. 

The Butler police officer was responding to a report of a "male acting erratically and jumping in and out of oncoming traffic" just before 7 a.m. Butler is a city just north of Pittsburgh. He came across the suspect "immediately" upon arriving at the scene and the pair began to struggle," the Pennsylvania State Police said in a press release. 

PHILADELPHIA BROAD DAYLIGHT SHOOTING LEAVES 1 DEAD, 4 INJURED AS CITY GRAPPLES WITH CRIME WAVE

"During the struggle the officer was stabbed multiple times," police said. "After being wounded, the Butler city Officer discharged his department issued firearm, striking and fatally wounding the male." 

CLICK HERE TO GET THE FOX NEWS APP

The wounded officer was rushed via helicopter to a Pittsburgh hospital, where he was in critical but stable condition and underwent surgery. Authorities described him as a 27-year-old U.S. Marine Corps. veteran with three years on the job with the police department. 

The suspect was identified as John Ebberts, a 35-year-old Butler man. State police, the local district attorney's office and the coroner's office are investigating.