We set up a two-country general equilibrium model, in which heterogeneous firms from one country (the source country) can offshore routine tasks to a low-wage host country. The most productive firms self-select into offshoring, and the impact on welfare in the source country can be positive or negative, depending on the share of firms engaged in offshoring. Each firm is run by an entrepreneur, and inequality between entrepreneurs and workers as well as intra-group inequality among entrepreneurs is higher with offshoring than in autarky. All results hold in a model extension with firm-level rent sharing, which results in aggregate unemployment. In this extended model, offshoring furthermore has non-monotonic effects on unemployment and intra-group inequality among workers. The paper also offers a calibration exercise to quantify the effects of offshoring.