Ibn khaldun's life may be divided into three parts, the first of which (20 years) was occupied by his childhood and education, the second (23 years) by the continuation of his studies and by political adventures, and the third (31 years) by his life as a scholar, teacher and magistrate. The first two periods were spent in the Muslim West and the third was divided between the Maghrib and Egypt. Ibn khaldun was born in Tunis, on 1 Ramadan 732/27 May 1332, in an Arab family which came originally from the Hadramawt and had been settled at Seville since the beginning of the Muslim conquest (Ibn Hazm, Dhamhara, ed. Levi-Provencal, 430), playing there an important political role. The family then left Seville for Ceuta immediately before the Reconquista. From there they went to Ifriqiya and settled in Tunis during the reign of the Hafsid Abu Zakariyya' (625-47/1228-49). Ibn khaldun's great-grandfather, Abu Bakr Muhammad b. al-Hasan, who wrote a treatise on Adab al-katib (see E. Levi-Provencal, in Arabica, ii (1955), 280-8), was put in charge of the finances during the reign of Abu Ishaq (678-81/1279-83). The usurper Ibn Abi 'Umara (681-2/1283-4) put an end to his career and to his life, having him strangled after confiscating his possessions and subjecting him to torture. His son, Muhammad, also occupied various official positions, both at Bougie and Tunis, and died in 737/1337, after renouncing political life upon the fall of Ibn al-Lihyani (711-7/1311-7). The latter's son, the father of our Ibn khaldun, wisely avoided politics, leading the life of a faqih and man of letters (Ta'rif, 10-15).
He was thus able to ensure that his son 'Abd al-Rahman received a very thorough education. The latter also attended courses given by the most famous teachers of Tunis, to whom he devotes lengthy sections in his autobiography (Ta'rif). He thus received a classical education, based essentially on the study of the qur'an, of hadith, of the Arabic language and of fiqh. The Marinid invasion (748-50/1347-9) resulted in the arrival in Tunis, with the sultan Abu 'l-Hasan, of a large number of theological and literary scholars. This widened the horizons of the young Ibn khaldun, who was thus enabled, particularly under the supervision of al-Abili, to learn about the philosophy and the main problems of Arabo-Muslim thought. He was however to undergo much suffering. The Marinid occupation ended in disorder and bloodshed, and in addition the terrible Black Death which ravaged the world in the middle of the century, coming from the East, claimed many victims in the country, among them Ibn khaldun's parents. He was at this time 17 years of age and was to retain all his life a memory of the horror of this event, which is reflected in many passages in his Ta'rif and his Muqaddima. This was the first traumatic experience of his life, which was later to have an undoubted influence on the direction of his thought. In addition, the departure of the Marinid scholars left a great intellectual vacuum at Tunis, and it seems that at this time the sole aim of the young Ibn khaldun was to leave Tunis for Fez, then the most brilliant capital of the Muslim West. He states (Ta'rif, 55) that he had a great thirst for learning. His elder brother, Muhammad, dissuaded him from his project, but not for long