This paper presents novel empirical evidence for the prediction from Becker’s (1957) classical theory, that competition drives discrimination out of the market. We use a comprehensive business registration reform in Portugal as a quasi-natural experiment to study the effect of increased product market competition on gender discrimination. We use employer-employee data for the universe of private sector firms and workers, and exploit the staggered implementation of the reform across municipalities for identification. Increased competition following the reform increases growth of the female employment share and reduces the gender pay gap for middle-managers and for medium- and high-skilled workers but not for top-managers or the unskilled. We also find that discriminatory employers, approximated by a low female employment share, are more likely to exit and those that survive reduce overall employment growth following the reform, while non-discriminatory employers grow faster. Existing evidence has shown that gender discrimination reduces output; our findings suggest that entry deregulation can contribute to reduce inefficiencies arising from gender discrimination.