This paper studies quality upgrading to escape competition from low-wage countries and proposes a new channel that does not rely on access to new inputs or markets. Informed by Peruvian apparel firms' response to China's WTO accession, I introduce factor specificity in a multi-product-firm model. Profitability losses due to competition in low-quality segments induce Firms to reallocate specific factors to produce high-quality varieties for high-income countries. Gains from this channel are large. Using an observed quality measure, I show that import competition substantially increases domestic firms' exports and high-quality export shares. Firms also reduce prices, resulting in additional welfare gains.