This paper proposes a new mechanism linking trade and wage inequality in developing countries the quality-upgrading mechanism and investigates its empirical implications in panel data on Mexican manufacturing plants. In a model with heterogeneous plants and quality-differentiated goods, only the most productive plants in a country like Mexico enter the export market, they produce higher-quality goods to appeal to richer Northern consumers, and they pay high wages to attract and motivate a high-quality workforce. An exchange-rate devaluation leads initially more-productive, higher-wage plants to increase exports, upgrade quality, and raise wages relative to initially less-productive, lower-wage plants within each industry. Using the late-1994 peso crisis as a source of variation and a variety of proxies for plant productivity, I find that initially more-productive plants increased the export share of sales, white-collar wages, blue-collar wages, the relative wage of white-collar workers, and ISO 9000 certification more than initially less-productive plants during the peso crisis period, and that these differential changes were greater than in periods without devaluations before and after the crisis period. A factor-analytic strategy that relies more heavily on the theoretical structure and avoids the need to construct proxies finds similar results. These findings support the hypothesis that differential quality upgrading induced by the exchange rate shock tended to increase within-industry wage inequality.