Denver police fatally shot a man who was waving a handgun in the air and holding it to his head when officers arrived on scene Tuesday evening.

The shooting took place after 6:30 p.m. in the 2600 block of South Federal Boulevard. The man was taken to a local hospital, where he was declared dead.

“I heard them yelling commands at him, and then I heard a loud ‘bang,’ ” said Mike Gorby, a neighborhood resident.

Police said they were called to the scene after 6:30 p.m. after a report of a suicidal person. Upon arriving, they found a man who was threatening Denver firefighters with a gun, said police spokeswoman Raquel Lopez.

The firefighters had originally arrived in response to a call of an overdose, at about 5:30 p.m., police said.

Michael Blowe, a witness, captured the incident on video.

“It looked like he was trying to get away,” he said.

Police fired beanbags at the man, and that is when he turned to run, Blowe said.

“That is when they shot him for real,” he said.

Lopez said she would not comment on the active investigation.

South Federal Boulevard was closed at West Vassar Avenue, as well as between West Yale and West Harvard avenues, during the investigation.