I investigate the effect of US border enforcement on the net flow of Mexican undocumented migration, both of which have been considerably increasing in the last 3 decades. This effect is theoretically ambiguous, as increases in border controls deter prospective migrants from crossing the border illegally but lengthen the duration of current illegal migrations. The inflow and outflow of illegal Mexican migration respond to changes in border enforcement. The marginal effect of enforcement on the inflow increases with enforcement and is consistent with the hypothesis that tighter enforcement selects more productive migrants. This positive selection makes the outflow sensitivity to marginal enforcement changes comparatively more stable over time. A marginal increase in border controls increases the stock of undocumented migrants between 1972 and 1986, has either no effect or a small and negative effect between 1987 and 1996, and has a larger and significant negative effect between 1997 and 2003.