Using firm-level data from 139 countries, this paper investigates the effect of competition in both the domestic and foreign markets on firm productivity and export decisions. Applying a sample selection endogenous treatment (SSET) Poisson model that tackles both the issue of endogenous sample selection and endogenous treatment at the same time, we document robust evidence that strong competition in the domestic market propels firms to be more productive, and decreasing domestic competition increases firms’ propensity to export. However, firms’ export intensity (i.e. how much they export) is not directly influenced by competition in the domestic market. Moreover, lower competition in the foreign market increases the propensity of domestic firms to export, enlarging the set of exporting firms to include firms with relatively smaller export amounts.