In an experiment we identify a crucial factor that determines whether employers engage in statistical discrimination of ex-ante equal groups. In the standard no-competition setup of Coate and Loury (1993), we do not find systematic evidence for statistical discrimination. When we introduce competition between workers of different groups for the same job, the non-discrimination equilibrium ceases to be stable. In line with this theoretical observation, we find systematic discrimination in the experimental treatment with competition. Nevertheless, a substantial minority of the employers refuses to discriminate even when it is in their best interest to do so.