A Philadelphia police officer fatally shot a naked man who attacked the officer Sunday in the Olney section, a department spokesman said.

Fearing for his life, the officer fired four times, striking the man three times in the chest and arm, said Lt. Raymond Evers.

That was after the two had struggled over the officer's gun and the victim continued to be aggressive after being Tasered, Evers said.

"This was a violent struggle," Evers said.

He did not identify the police officer or the victim, who was 31 and was believed to live near where the shooting occurred.

Police said the incident began around 6 a.m. when a passerby told an officer on patrol near the 5900 block of Mascher Street that an unclothed man was running around. When the officer, a six-year veteran, stepped out of his patrol car, the man attacked him, Evers said.

At some point during the struggle, the officer Tasered the man, but it had no effect, and the struggle continued, Evers said.

The man was prounced dead at Einstein Medical Center at 6:22 a.m. Toxicology tests will be conducted, Evers said.

The officer suffered bumps and bruises and his uniform was torn during the struggle, police said.

He is on administrative duty pending an investigation by Internal Affairs and the District Attorney's Office, which is standard protocol. The homicide department, which routinely investigates deaths involving police, is also looking into the case.

According to police, the victim had previous arrests on charges including robbery and an assault on a police officer. The outcome of those cases could not be determined Sunday.

Contact Darran Simon at 856-779-3829 or dsimon@phillynews.com, or follow on Twitter @darransimon.