Play video content South Pasadena Police Department

Cops repeatedly warned "ER" actress Vanessa Marquez to put down a gun before they opened fire -- and the incredibly tense scene plays out in this bodycam footage police just released.

In the video, from August 2018, cops entered Vanessa's South Pasadena home to do a welfare check. She was laying in bed, and said she had just suffered a seizure ... but was refusing to go to a hospital.

A mental health clinician spoke to her for about 30 minutes, and then cops told Vanessa they were placing her on a 5150 psychiatric hold because she was a danger to herself and others. Vanessa refused to cooperate, and pulled out a pair of scissors and a gun ... prompting officers to draw their weapons while retreating from her room.

As the cops barked orders for her to drop the gun, Vanessa yelled back, "Kill me." Moments later, she walks downstairs with the gun pointing in the cops' direction and that's when they fired 12 shots. Cops recovered her weapon ... which turned out to be a replica.

As we reported ... her landlord had called police, saying he was worried about the actress' well being. After her encounter with cops, Vanessa was rushed to the hospital where she died. The D.A.'s Office found the officers acted appropriately because they "actually and reasonably believed Marquez posed an imminent threat of great bodily injury or death."

At the time, authorities had said Vanessa -- who played Wendy Goldman on "ER" -- was suffering from an eating disorder which is what triggered her seizures..