Rich Homie Quan wasn't lashing out at a fan when he smacked a guy at a concert earlier this month ... he was dishing out justice to a dude he says was TRYING TO ROB HIM.
As we reported ... Quan was performing on stage in Racine, Wisconsin July 4 when someone in the crowd grabbed his arm. It appeared the man was trying to pull himself on stage.
But a rep for Quan tells TMZ ... the guy wasn't trying to steal the limelight ... he was trying to steal Quan's watch ... right off his wrist. And that's why the rapper knocked him upside the head.
Quan himself tells us: "The person that tried to rob me was not one of my fans. My fans are loyal to me. I did what anyone else would do if they were being robbed."