Abd al-Rahman ibn Muhammad ibn Khaldun was Arab philosopher, historian and social thinker. He was one of the most original thinkers of the Middle Ages. He was also a politician and diplomat. In his treatise, the Muqaddima, he pioneered a general sociological theory of history.
Ibn Khaldun was born on May 27, 1332 in Tunis. He studied the traditional religious sciences including law according to the Maliki school. He also was trained in the arts. In 1345, his parents died of the plague, and he found employment at the court of the Hafsids.
In 1357 he was imprisoned for 22 months as he was suspected of plotting against the ruler.
In 1362 he went to Granada, where he was well received by the vizier, Ibn al-Khatib.