Insane moment for ex-UFC fighter Dean Lister ... who pulled a firearm on a man who was robbing his house -- and the whole thing was captured on video.

42-year-old Lister -- who was 13-7 as an MMA fighter -- says he arrived to his San Diego home around 8 PM on Saturday when he saw a tatted up bald dude inside of his kitchen.

The man was super sketchy and told Lister he thought the home was a church -- but when Lister continued to press, the man picked up a hammer in a very threatening manner.

"Off camera, I drew a sidearm and he stopped advancing toward me," Lister said.

"I LET him escape with his life through a window. Cops said I was legally good if I killed him."

Lister says the man stole a bunch of cash out of the home and he published the video publicly in the hopes someone can identify the INTRUDER.

"Police are on it but if anyone knows who he is please help me,,, thank you very much."