The demographic history of human populations in North Africa has been characterized by complex migration processes that have determined the current genetic structure of these populations. We examined the autosomal markers of eight sampled populations in northern Africa (Tunisia and Libya) to explore their genetic structure and to place them in a global context. We genotyped a set of 30 autosomal single-nucleotide polymorphisms (SNPs) extending 9.5Mb and encompassing the 17q21 inversion region. Our data include 403 individuals from Tunisia and Libya. To put our populations in the global context, we analyzed our data in comparison with other populations, including those of the 1000 Genomes Project. To evaluate the data, we conducted genetic diversity, principal component, STRUCTURE, and haplotype analyses. The analysis of genetic composition revealed the genetic heterogeneity of North African populations. The principal component and STRUCTURE analyses converged and revealed the intermediate position of North Africans between Europeans and Asians. Haplotypic analysis demonstrated that the normal (H1) and inverted (H2) polymorphisms in the chromosome 17q21 region occur in North Africa at frequencies similar to those found in European and Southwest Asian populations. The results highlight the complex demographic history of North Africa, reflecting the influence of genetic flow from Europe and the Near East that dates to the prehistoric period. These gene flows added to demographic factors (inbreeding, endogamy), natural factors (topography, Sahara), and cultural factors that play a role in the emergence of the diverse and heterogeneous genetic structures of North African populations. This study contributes to a better understanding of the complex structure of North African populations.