The continent of Africa is second-largest and second most-populated land mass in the world. It is bordered to the north by the Mediterranean Sea, to the northeast by the Isthmus of Suez and the Red Sea, to the southeast by the Indian Ocean and to the west the Atlantic Ocean. It encompasses Madagascar and various archipelagos. Within it are 54 countries, nine territories and two de facto independent states with restricted recognition.
The continent offers a rich tapestry or archaeology and ancient history. Around 3300 BC, historical records open in Northern Africa with the rise of literacy in Ancient Egypt Pharaonic civilisation; an early and longest-lasting civilizations. The Egyptian state continued, with varying degrees of influence over other areas, until 343 BC and penetrated into modern-day Libya and Nubia, and, some say, as far north as Crete. Phoenicians from Tyre on the north-west African coast at Carthage established an independent centre of civilisation with trading links to Phoenicia. Ancient Greeks and Romans began European exploration of Africa. In 332 BC, Alexander the Great was applauded as a liberator in Persian-occupied Egypt. He founded Alexandria in Egypt, which evolved into the prosperous capital of the Ptolemaic dynasty following his death.
After Roman’s conquest of North Africa's Mediterranean coastline, the area was integrated economically and culturally into the Roman system. There was a Roman settlement in modern Tunisia and elsewhere along the coast. Septimius Severus was first Roman emperor native to North Africa. He was born in Leptis Magna in what is now Libya—his mother was Italian Roman and his father was Punic.
At an early date Christianity spread across these areas from Judaea via Egypt and extended beyond the Roman borders into Nubia; by around AD 340, due to Syro-Greek missionaries, who arrived by way of the Red Sea and influenced the state religion of the Aksumite Empire.
The newly formed Arabian Islamic Caliphate expanded into Egypt, in the early 7th century, and then into North Africa. Shortly afterwards, the local Berber elite had been integrated into Muslim Arab tribes. In the 8th century, when the Umayyad capital Damascus fell, the Islamic centre of the Mediterranean moved from Syria to Qayrawan in North Africa. Islamic North Africa had become diverse, and a hub for mystics, scholars, jurists, and philosophers. At this time Islam spread to sub-Saharan Africa, mainly through trade routes and migration.