In 750, the Umayyad dynasty was overthrown by another family of Meccan origin, the Abbasids. Their time represented a scientific, cultural and religious flowering. Islamic art and music also flourished significantly during their reign. Their major city and capital Baghdad began to flourish as a center of knowledge, culture and trade. This period of cultural fruition ended in 1258 with the sack of Baghdad by the Mongols under Hulagu Khan. The Abbasid Caliphate had however lost its effective power outside Iraq already by c. 920. By 945, the loss of power became official when the Buyids conquered Baghdad and all of Iraq. The empire fell apart and its parts were ruled for the next century by local dynasties.