In dramatic scenes outside a school in Sao Paulo an armed robber's attempt to hold up mothers outside a school backfired lethally when a brave off-duty cop emerged from the frightened crowd and gunned him down.

Footage shows the suspect named as Elivelton Neves Moreira, aged 21, approach the private school as mothers with their children gathered for a Mother's Day Celebration. However, his attempted robbery was thwarted when military police officer Katia da Silva Sastre, aged 42, pulled out her service weapon and fired three shots at close range. Moreira fired once but missed.

Moreira, who would later die in hospital, was then pined to the ground by Sastre who put her foot on his back and pointed her gun at his head.

Officer Sastre, the mother of two girls, was hailed a hero by the Sao Paulo Governor Marcio Franca for her bravery under fire. She had shown "dexterity, technique and courage," he said.

The officer, who has two decades of experience in the military police, said she wanted to shoot the man at a close range and neutralize him before he could hurt anyone. "I reverted to the training. I just thought about defending mothers, children, my own life and my own daughter," Da Silva told Brazilian newspaper O Globo.