The Abbasid dynasty fell when Hulagu Khan, the grandson of Genghis Khan, led an attack against its capital, Baghdad, in 1258. The Mongols sacked Baghdad, destroyed its library and killed Al-Musta'sim, its caliph.
After defeating the Umayyad caliphate in 750, the Abbasid dynasty became the third Islamic caliphate. Choosing to de-emphasize Arab ethnicity and focus on the international aspect of Islam, the Abbasid caliphate moved its capital from Damascus in Syria to Baghdad. Though the Abbasids adopted a Persian method of government, they based their laws on the Islamic religion. For almost a century, the period of the Abbasid dynasty became a golden age of Islam, with its rulers promoting advances in medicine, astronomy, science and the arts. During this time, their mathematicians invented algebra, scientists developed a primitive battery for electricity, astronomers discovered new stars and writers created a deep literary canon.
Even before the Mongols attacked, the integration of Turkish mercenaries into the army had weakened the Abbasid's defenses. Assassination of caliphs who would not accede to the orders of army officers became common. The leaders of surrounding territories demanded autonomy. By the time Hulagu Khan attacked Baghdad, the Abbasid caliph was little more than a religious figurehead.