Gender wage differentials, conditional on observed productivity characteristics, have been considered a possible indication of prejudice against women in the labor market. However, there is no conclusive evidence on whether these differentials are due to labor market discrimination or to unobserved productivity differences. The objective of this paper is to propose a solution for this identification problem by developing and estimating a search model of the labor market with matching, bargaining and employers' taste discrimination. In equilibrium all types of employers wage discriminate women: prejudiced employers because of preference and unprejudiced employers because of spillover effects that worsen the bargaining position of women. Estimation is performed by maximum likelihood on Current Population Survey data for the year 1995. Results indicate that the productivity of women is 6.5% lower than the productivity of men and that about half of the employers are prejudiced against women. Three policy experiments are implemented using the estimated parameters: an equal pay policy, an affirmative action policy and a wage differential decomposition that takes into account equilibrium effects.