It has been hypothesized that the ratio of X-linked to autosomal sequence diversity is influenced by unequal sex ratios in Drosophila melanogaster populations. We conducted a genome scan of single nucleotide polymorphism (SNP) of 378 autosomal loci in a derived European population and of a subset of 53 loci in an ancestral African population. On the basis of these data and our already available X-linked data, we used a coalescent-based maximum-likelihood method to estimate sex ratios and demographic histories simultaneously for both populations. We confirm our previous findings that the African population experienced a population size expansion while the European population suffered a population size bottleneck. Our analysis also indicates that the female population size in Africa is larger than or equal to the male population size. In contrast, the European population shows a huge excess of males. This unequal sex ratio and the bottleneck alone, however, cannot account for the overly strong decrease of X-linked diversity in the European population (compared to the reduction on the autosome). The patterns of the frequency spectrum and the levels of linkage disequilibrium observed in Europe suggest that, in addition, positive selection must have acted in the derived population.