Terrifying surveillance video captured the moment a wealthy Los Angeles homeowner opened fire on a pair of masked intruders who snuck up behind him as he walked up to his door.

The man is seen walking up to his Mid-City house about 7:30 p.m. Saturday, holding a drink in one hand and taking his keys out of his pocket with the other, footage posted by ABC 7 and Fox 11 Los Angeles shows.

One of the men, dressed in all black, sneaks up on him — but he quickly turns the tables by throwing his cup, whisking out a handgun and opening fire on the fleeing bandit.

“Out of nowhere I felt someone run up behind me, put something to my back, put a pistol to my back and somebody running up,” the man told ABC 7.

“I guess they decided to try to come at me and come in the house but I have a 5-month-old baby and a wife and a nanny in the house and that wasn’t going to happen,” he said.