This paper analyzes the issues of immigration and outsourcing in a general-equilibrium model of international factor mobility. In our model, legal immigration is controlled through a quota, while outsourcing is determined both by the firms (in response to market conditions) and through policy-imposed barriers. A loosening of the immigration quota reduces outsourcing, enriches capitalists, leads to losses for native workers, and raises national income. If the nation targets an exogenously determined immigration level, the second-best outsourcing tax can be either positive or negative. If in addition to the immigration target there is a wage target (arising out of income distribution concerns), an outsourcing subsidy is required. The analysis is extended to consider illegal immigration and enforcement policy. A higher legal immigration quota will lead to more illegal immigration if skilled and unskilled labor are complements in production. If the two kinds of labor are complements (substitutes), national income increases (decreases) monotonically with the level of legal immigration.