Compliance with social rules is crucial for fostering cooperation in societies. Motivated by observational evidence from large-scale traffic violation data in a major city in China, we investigate the impact of social identity on rule-following behavior. We empirically showed that traffic violations are significantly less severe when individuals drive in foreign cities rather than the local city where the car is registered, a phenomenon we describe as the “compliance minority effect”. We next conducted a laboratory experiment with a street-crossing task, to further investigate the key drivers behind the compliance minority phenomenon. We found that participants exhibit more rule compliance when identifying as an outgroup minority than a local majority only when both observability and social sanctions are at play. Participants form the prior belief that being part of a minority in the community is associated with a higher chance of being monitored and punished than when they are part of the local majority, which is consistent with the posterior observations. Our results suggest that majorities can enforce augmented social norms on minority groups through an interplay of observability and punishment, which could lead to unintended consequences of local privilege that hamper the equality and efficiency of society.