Drosophila melanogaster is an important model organism in evolutionary genetics, yet little is known about the population structure and the demographic history of this species within sub-Saharan Africa, which is thought to contain its ancestral range. We surveyed nucleotide variation at four 1-kb fragments in 240 individual lines representing 21 sub-Saharan and 4 Palearctic population samples of D. melanogaster. In agreement with recent studies, we find a small but significant level of genetic differentiation within sub-Saharan Africa. A clear geographic pattern is observed, with eastern and western African populations composing two genetically distinct groups. This pattern may have resulted from a relatively recent establishment of D. melanogaster in western Africa. Eastern populations show greater evidence for long-term stability, consistent with the hypothesis that eastern Africa contains the ancestral range of the species. Three sub-Saharan populations show evidence for cosmopolitan introgression. Apart from those cases, the closest relationships between Palearctic and sub-Saharan populations involve a sample from the rift zone (Uganda), suggesting that the progenitors of Palearctic D. melanogaster might have come from this region. Finally, we find a large excess of singleton polymorphisms in the full data set, which is best explained by a combination of population growth and purifying selection.