Economic integration has intensified international competition to attract productive capital. This paper analyzes, both theoretically and empirically, the effect of tax policies and institutional quality on the allocation of FDI - two aspects that the economic literature has extensively investigated, though only in isolation. I build a simple two-country partial equilibrium model to study competition among governments vying for potential investors whose location choices are driven by both the quality of institutions and the corporate tax rate. Modeling good governance as a public good, it is shown that the jurisdiction providing better institutions is able to levy a higher tax on capital. Moreover, provided firms are sensitive enough to institutional quality, it attracts a larger share of investment than the low-quality/low-tax location. The main predictions of the model are tested on FDI stocks to 63 economies using a simple difference gravity equation derived from discrete choice theory of firms' location. Using a pair of destination countries as the unit of analysis eliminates the need to control for multilateral interdependence among receiving countries, a source of possible bias in the traditional gravity specification in the levels. The empirical evidence corroborates the claim that the sensitivity of foreign investment to the tax rate varies significantly between host countries characterized by different levels of institutional quality. The findings are robust to a number of sensitivity checks and to the use of instrumental variables to tackle endogeneity of the institutional quality variable.