A Pennsylvania man was shot and killed by police on Wednesday after he allegedly shot an officer in the chest as officers attempted to serve a warrant, according to authorities. 

Pennsylvania State Police said the shooting occurred as officers with the Camp Hill, Newville, and North Middleton Township police departments were serving an arrest warrant for Roger Wayne Ellis, 54, at a residence in Carlisle around 3:30 p.m. 

Ellis had an active arrest warrant for fleeing and eluding police, as well as multiple other warrants, police said

1 DEAD, 2 INJURED IN PHILADELPHIA AREA COLLEGE DORM STABBING

Roger Wayne Ellis, 54, had an active arrest warrant for fleeing and eluding police, as well as, multiple other warrants, authorities said

Roger Wayne Ellis, 54, had an active arrest warrant for fleeing and eluding police, as well as, multiple other warrants, authorities said (Camp Hill Police Department)

When responding officers arrived, they verified that Ellis was inside the residence, and obtained consent from the homeowner to enter, according to a preliminary police investigation. 

Officers announced and identified themselves while attempting to get Ellis to come out of the home, but he refused, police said. 

"During this time Ellis produced a handgun and shot a North Middleton Township Officer at close range inside the residence, striking the officer in their bulletproof vest," police said. 

Authorities said officers retreated and established a perimeter before Ellis exited the home and "came towards" the officer who was shot, while still armed with a handgun. 

PHILADELPHIA MAN SHOOTS ANOTHER MAN DURING ARGUMENT OVER WOMAN, REPORT SAYS

The officer then shot Ellis, who was pronounced dead at the scene, police said. The officer who was allegedly shot by Ellis was treated at a hospital for his injuries and has since been released, according to authorities. 

His identity was not immediately provided by police. 

Last month, Camp Hill police said they attempted to stop Ellis after he allegedly drove a vehicle with a DUI-suspended driver's license. Police said Ellis fled from officers attempting to stop him and committed numerous traffic offenses "in the process." 

His prior criminal history involved arrests for drunken driving charges in Cumberland County in 2008 and in 2011 as well as Adams County in 2011, the department said

CLICK HERE TO GET THE FOX NEWS APP

Pennsylvania State Police are currently handling the investigation. 

Carlisle is about 120 miles northwest of Philadelphia.