RIO DE JANEIRO — In the trendy Sao Paulo neighborhood of Pinheiros, a silver car with tinted windows glided down the tree-lined street on Friday. A garage door popped open, and the vehicle pulled into the darkened enclosure, beside a luxury black SUV.

That’s when the security footage — which shot into news reports this week and went viral on social media — stops being normal.

The doors of the silver car — which was stolen — opened. Out came five masked men clutching handguns. A resident of the house, a 23-year-old student, was eating breakfast in the kitchen, according to Sao Paulo police, watching the security footage. The armed intruders were coming in through the garage. He put down his food, then rushed upstairs to his bedroom and retrieved his own handgun.

Then, shirtless and in flip flops, he waited at the top of the stairs, gun at his side. He yelled at them to go away, but then a figure peeped around the corner. He fired once, twice, three times.

Down below, the intruders lurched back in surprise. They briefly returned fire before falling down the steps. They scooted out through the garage — apparently in such a fright that they decided to abandon their car — and vamoosed down the street on foot as confused neighbors watched.

No one was wounded in the shootout, police said.

In a country traumatized by pervasive crime, where many live in fear of violence, video of the shootout was red meat for conservatives calling to liberalize gun ownership laws. In January, Brazilian President Jair Bolsonaro, who won the presidency last year with calls to get tough on crime, signed a decree making it easier for the “good guys” to get guns. In May, he followed it up with another decree, easing restrictions on gun imports and ammunition purchases.

“How great that he was armed!” one person cheered on Twitter.

In Sao Paulo, the Western Hemisphere’s largest city, the wealthy have devised elaborate security systems to protect themselves from crime. Many wealthy people live behind tall concrete walls, guard towers, electrified wire, spotlights, double steel doors, and digital fingerprint analysis machines that decide who gets in and who doesn’t.

Then there’s simple security footage — which was what saved the resident of the targeted Sao Paulo home.

“I was having breakfast and I was watching my camera monitors,” the student said in an interview with Jovem Pan News, saying he preferred to stay anonymous for security reasons. “Then I realized there was a car getting inside my home, and the alarm turned on. They got in really quickly. … I had to get my gun in my bedroom, and by that time, they were already in the stairs, ready to get me.”

But they wouldn’t. Neither that day, nor any in the future, he vowed.

“I think that those who need to be afraid are them,” he told the Brazilian news outlet. “They better know that if they get in here again I’ll do it again, cause I’ll never allow them to do any harm to me or my family. They need to be afraid of us. It’s not us that need to be afraid of them.”

Police said they found one of the intruders’ ID and a wallet.