It probably was from his scent glands, called anal glands or sacs. They are used to scent mark his poo, but (like skunks) can also be used when they are scared. People usually don't notice they're there unless that happens or if they get impacted.