The paper analyses the nonlinearities in the impact of localization, diversity, urbanization and competition on firm-level total factor productivity (TFP), using a large sample of Italian firms from 1999 to 2007. We adopt a panel smooth transition regression model, so that the TFP elasticities are free to vary smoothly across two or more extreme values. Results show that localization economies and Jacobian externalities materialize only for values of, respectively, intra-industry agglomeration and extra-sectoral diversity above a certain threshold. Local competition exerts a positive effect on productivity, even though the marginal impact shrinks at high levels of competition. We find instead no evidence of diseconomies of agglomeration.JEL classification: C23, C24, D24, R12, R15