Born into a family of scholars and government officials, Ibn Khaldūn lost his family in 1349 to the Black Death. After the completion of his formal studies, he became a roving ambassador, serving a series of rulers in North Africa and Moorish Spain. At the same time, he began collecting material for his Kitāb al-ʿibar, or universal history, which he completed in 1382. The most important part of this work was its “Prolegomena,” or introduction, which made an attempt to establish a purpose for history. Disturbed by the decline of the Muslim states and Muslim civilization, Ibn Khaldūn sought to find reasons for it, after which he set forth a series of ethical principles that he believed must be followed to reverse the decline. Although he was a good Muslim, Ibn Khaldūn introduced the concept of natural causality. He believed that society was the creation and the responsibility of human beings. Ibn Khaldūn believed that social organization, and especially the state, was the key to improved individual welfare and the refinement of civilization. He held that rulers should develop ethical political principles such as placing the welfare of society before individual aggrandizement, ameliorating taxes, infusing the state with a sense of purpose, and avoiding unnecessary wars. Ibn Khaldūn spent the final years of his life in Cairo, where he was a Muslim judge and a professor.