Excerpts from Books and Wikipedia
"The conquest of Baghdad by the Buwayhids of Persia in 945 finally ended the Abbasids' territorial power but, because of its residual prestige, they retained the caliphate as a purely spiritual office. Despite this, the Shi'ite Buwayhids treated the Sunni caliphs with undisguised contempt and forced them to celebrate Shi'ite festivals. Although the Buwayhids maintained several magnificent places in Baghdad, the city lost it preeminence as an Islamic cultural center and by 1000 had been overtaken by Cairo, Cordoba, and Ghazni in this respect. Liberation, of a kind, came for the caliphate from the rising power of the Seljuk Turks--central Asian nomads who had converted to Sunni Islam around 1000. In 1054 their leader, Toghril Beg, answered a call for help from Caliph al-Qaim and invaded the Buwayhid emirate. On December 18, 1055, the caliph welcomed him into Baghdad as a liberator." [1001 Days]