Newly released dashboard and body camera videos show a deadly shootout between Los Angeles police and a gang member that left an officer injured and the suspect dead during a routine traffic stop.

The edited footage from the July 27 incident in San Fernando Valley was released on Monday by the Los Angeles Police Department.

The footage shows two officers, Miguel Alarcon and his female partner, who has not been named to protect her privacy as a victim of a crime, approaching a car carrying gang member Richard Mendoza in the North Hills neighborhood.

LAPD two officers were performing a routine check when they found themselves in a deadly shootout with a gangster on July 27

This body camera video shows a female officer asking the suspect about his probation status

Ex-convict Richard Mendoza replies to the officers that he still nine months to go

The officer orders Mendoza out of the car and reassures him that he's 'good'

This is the moment Mendoza opens fire on the female cop, shooting her in the leg from a close range

The female officer, who works in the gang unit, approaches on the right side and chats to the passenger inside the car.

The female officer asks Mendoza how he's doing and inquires if he is still on probation.

According to police, Mendoza was a known member of the Vincent Town street gang who went by the moniker 'Biz.' His criminal record included convictions for firearms possession by a felon and sale of narcotics.

'Nine more months, ma'am,' he replies, after which the officers order Mendoza to step out of the vehicle

'You don't have anything on you, right?' the officer demands.

As Mendoza slowly emerges from the car, the officer reassures him that he's 'good.'

'I know,' he replies,' moments before he points a gun at her and fires.

The female cop collapses to the ground with a bullet wound in her left leg and screams in agony.

Officer Miguel Alarcon's body camera shows Mendoza grabbing his gun before getting out of the car

Alarcon opens fire on the gunman after his partner gets shot, as seen in this screenshot from his body camera

The officers' dashboard camera offers another view of the shooting on July 27

Mendoza then turns his attention to Alarcon, who manages to duck and return fire, shooting Mendoza multiple times in the head and torso.

The mortally wounded suspect collapses to the ground, with blood gushing from his wounds and pooling beneath his body, as the video shows.

Alarcon radios dispatch for help, saying: 'officers need help. Shots fired.'

His partner is heard moaning on the ground and telling him she's been hit in her left leg. Alarcon comes over to inspect her wound and reassures, 'you're gonna be OK. I got you.'

Mendoza is seen lying on the ground next to his Nissan Altima after being shot multiple times

Richard Mendoza was a 32-year-old member of the Vincent Town street gang (pictured tight in his mugshot)

This is the .38 caliber handgun police say Mendoza used to shoot the officer

The female cop says her leg is burning, then directs Alarcon to 'just get him,' speaking of Mendoza.

Alarcon's body camera shows him walking over to the shooter lying face down and grunting on the ground, and restraining his bloodied arms behind his back as a precaution.

He was taken to a nearby hospital, where he later died of his injuries.

Alarcon's partner was also hospitalized to be treated for a broken femur in her left leg. She is said to be recovering.

Alarcon's camera captured him coming over to his partner's side to check on her leg wound

Alarcon is seen placing handcuffs on a dying Mendoza, with blood streaking his arms

'By the grace of God she is alive,' LAPD Chief Michel Moore told the LA Times. 'Officers are fearful in these situations and the public here gets to see why.

'Once a person has you in that position it is very tough,' he said. 'You cannot stop that first one or two shots.'

Retired LAPD Sergeant Mike Sayre told Fox 11 that the video is a good example of how quickly police officers have to respond.