Discrimination reduces the matching probability and output in the skill-intensive differentiated-product sector so that discrimination-induced comparative advantage may overshadow technological comparative advantage in determining the pattern of trade. Trade liberalization generates a decrease in the skilled-worker wage gap in the country that is an exporter of goods from the simple sector but increases it in the country that is a net exporter of differentiated products. Trade liberalization has an opposite effect on firms. In the country that is an exporter of simple goods, trade liberalization reduces the profits of the nondiscriminatory firms by more than those of the discriminatory firms. (JEL F16, F66, J71).