The genetic history of North Africa encompasses the genetic history of the people of North Africa. The most important source of gene flow to North Africa from the Neolithic Era onwards was from Western Asia, while the Sahara desert to the south and the Mediterranean Sea to the north were also important barriers to gene flow from sub-Saharan Africa and parts of Europe in prehistory. However, North Africa is connected to Western Asia via the Isthmus of Suez and the Sinai peninsula, while at the Straits of Gibraltar, North Africa and Europe are separated by only 15 km (9 mi), similarly Malta, Sicily, Canary Islands, Lampedusa and Crete are close to the coasts of North Africa, with the indigenous Guanche people of the Canary Islands being Berber.
North Africa is a genetically heterogenous and diverse region, and is characterized by its diverse ethnic groups, the main ones being Arabs, Berbers and Copts (in Egypt). North African populations show a complex and heterogeneous genetic structure that has been described as an amalgam of at least four different ancestral components from the Middle East, sub-Saharan Africa, Europe and also indigenous North Africans who are genetically distinct from these three. Although North Africa has experienced gene flows from the surrounding regions, it has also experienced long periods of genetic isolation. Some genetic studies have been criticised for their interpretation and categorisation of African genetic data.