This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

DENVER — Dramatic video of a shooting from a police officer’s body camera was released Wednesday.

The Denver district attorney’s office released it after a decision Monday that Denver officer Jeffrey Heinis was justified in shooting and injuring the suspect during a foot pursuit in August.

RELATED: District attorney’s decision letter

The officer said the 17-year-old carjacking suspect was brandishing a gun and he was afraid the suspect would shoot him or someone else. He believed he had no choice but to fire his own weapon.

Warning: The video is graphic and might not be suitable for some viewers.

The shooting happened just before 5 p.m. on Aug. 16 in the parking lot of Denver Community Credit Union at 1095 Federal Blvd. Heinis spotted a vehicle that had been carjacked at gunpoint two days earlier in Arapahoe County.

When officers approached the vehicle, three suspects got out and took off running. A 17-year-old male suspect was carrying a gun, and an investigation by the Denver and Aurora police departments found Heinis shot him in the leg.

The body camera footage shows Heinis jumping out of his patrol car.

“See some hands. Show me your hands. Show me your hands,” he shouted at the suspect.

The officer pulled out his gun while shouting that the suspect was armed.

“He’s got a gun,” he is heard saying.

The teenager ran in front of the officer toward a fence. The officer followed and fired his weapon. There were 12 shots.

“He’s got a gun. Be careful,” he said on the recording.

The teen jumped the fence and was captured on the other side. He was shot in the ankle. His semiautomatic handgun was on the ground near him. The whole incident took less than 25 seconds.

“The driver who gets out, I can see he’s holding a black semi auto handgun in his hand,” Heinis told investigators. “I became very fearful he was going to shoot me with the gun.  He didn’t leave the gun in the car.  He didn’t try to conceal it.  He had already used it in the commission of a violent felony.”

Heinis also said he feared the suspect would try to shoot or carjack someone else once he got over the fence.

“I considered him a very imminent threat to everybody in the area, including myself,” he said during the investigation.

The suspect, who has a lengthy record, was charged with felony menacing, possession of a weapon by a previous offender and motor vehicle theft, the district attorney’s office said.

He pleaded guilty to the menacing charge in November and was committed to the Division of Youth Corrections for at least one year.