The Spokane County Medical Examiner identified a man who was shot and killed by a Spokane police officer Wednesday afternoon.

The medical examiner identified the man as David W. Shafer, 61, on Friday. The medical examiner confirmed Shafer died from two gunshot wounds to his torso. The examiner determined the manner of death was homicide.

Shafer was shot and killed on Wednesday afternoon after he pointed a gun at a Spokane police officer, according to the Spokane police chief. 

Chief Craig Meidl said officers were called around 1:30 p.m. to a suicidal man, later identified as Shafer, in the 3400 block of East Garnet Avenue, about a block from Cooper Elementary in the Hillyard neighborhood. 

In a press release, Spokane Police Officer John O'Brien said it was reported that Shafer was walking down the street with a firearm. 

Meidl said officers arrived and set up a perimeter. While an officer was in the area, he saw Shafer come out of a home with a firearm in his hand and pointed it in the direction of what the officer thought was another person, Meidl said.

Meidl said the officer ordered the man to drop the gun.

"When the individual heard that, he turned around and pointed the gun at the officer and, at the time the individual pointed the gun at the officer, the officer fired at least two times," Meidl said. 

The officer was about three houses away and armed with a rifle when he fired the shots, according to Meidl. 

Meidl said first aid was given to Shafer immediately but he died from his injuries. 

Witnesses say Shafer's friends tried to comfort him

Two witnesses at the scene told Spokane police that Shafer's friends tried to help him before the deadly shooting. 

The witnesses told police that two of Shafer's friends learned he had become suicidal and went to his home to comfort him, Meidl said. They were allegedly able to get one gun away from him before police arrived. Officials said they called 911.  

Meidl said one firearm was recovered from the area near Shafer. 

Spokane Police Sergeant Terry Preuninger said the involved officer had his body camera turned on.

The Spokane County Sheriff's Office will be the lead agency in the investigation into the shooting and they will be assisted by Washington State Patrol, Meidl said. They will identify the officer involved in the shooting. 

Spokane police are asking anyone with surveillance video of the incident to notify detectives so it can be collected as part of the investigation.  

RELATED: Citizen recognizes St. Maries fugitive in Spokane, leading to arrest

RELATED: Missing Spokane teen Sara McNease found 'alive and well' in California

RELATED: Washington gets nearly $5.3 million to test backlogged rape kits