r in an official capacity. Ibn Khaldun took gifts with him for Tamerlane and they were well received; he stayed in Tamerlane’s camp for thirty-five days.
Over this period, Ibn Khaldun had many meetings with Tamerlane, conversing through an interpreter, Abd al-Jabbar al-Khwarizmi (d. 1403 A.C.E. / A.H.). Ibn Khaldun’s account is the only detailed account available; the subjects they discussed were varied and some were unrecorded. Walter Fischel lists six specific topics about which they talked:
1. The Maghrib and Ibn Khaldun’s land of origin;
2. Heroes in history;
3. Predictions of things to come;
4. The Abbasid Caliphate;
5. Amnesty and security “for Ibn Khaldun and his companion;”
6. Ibn Khaldun’s intention to stay with Tamerlane. 
Ibn Khaldun impressed the conqueror enough that he was asked to join Tamerlane’s court. Some biographers have suggested that he did plan to join Tamerlane’s court and that he wrote his eloquent appeal to return to Egypt to settle his affairs, get his books and family and join Tamerlane. However, it is more likely that Ibn Khaldun left on good terms with Tamerlane, and accomplished his mission of extracting favorable terms for the people of Damascus. 
Ibn Khaldun’s departing words lend credence to the fact that he would not be returning to his service:
Is there any generosity left beyond that which you have already shown me? You have heaped favors upon me, accorded me a place in your council among your intimate followers, and shown me kindness and generosity which I hope Allah will repay to you in like measures. 
Upon Ibn Khaldun’s return to Egypt, he was restored to his position as Maliki judge. Due to the political situation within the community of Maliki judges, Ibn Khaldun was dismissed and reinstated three times during the five-year period. He died while in office on Wednesday, March 17 1406 A.C.E. (25 of Ramadan 808 A.H.). He was buried in the sufi cemetery outside Bab an-Nasr, Cairo at the age of seventy-four. 
Ibn Khaldun’s works can be classified in the categories of historical, and religious. Of his works on history, only his Universal History has survived to our day. Another work that is lost is the history that was written specifically for Tamerlane, as Ibn Khaldun mentioned in his autobiography. His religious books are: Lubab al-Mahsul (Summary of the Result); a commentary on an usul al-fiqh poem, and a few works which are of questionable attribute to him, namely a sufi tract “Shifa’ as-Sail” (Healing of the Inquirer). 
Ibn Khaldun’s magnum opus, “al-Muqaddimah” can be divided into three parts. The first part is the introduction, the second part is the Universal History, and the third part is the history of the Maghrib. In this section, I concentrate on the first part. The second part is similar to the standard histories of Muslim historians, and there does not seem to be much divergence. The third part, which is concerned with the history of the Maghrib, is considered a primary source work.  Much of the information in this section is from Ibn Khaldun’s personal travels and contacts in the area, and is replete with first hand accounts. An additional work that is not usually considered a part of this book is an appendix, which is an autobiography of the author.
The first part, the “Introduction,” is popularly known as “al-Muqaddimah;” Ibn Khaldun wrote this in a span of five months.  It can be divided into six parts as follows:
1. Human society – ethnology and anthropology
2. Rural civilizations
3. Forms of government and forms of institutions
4. Society of urban civilization
5. Economic facts
6. Science and humanity
This impressive document is the essence of Ibn Khaldun's wisdom and hard earned experience. Ibn Khaldun used his political and first-hand knowledge of the people of Maghrib to formulate many of his ideas. This document summarizes Ibn Khaldun’s ideas about every field of knowledge during his day. He discusses a variety of topics, including history and historiography. He rebukes some historical claims with a calculated logic, and discusses the sciences of his time. He wr