A convoluted struggle for control of the office of "amir al-umara", and the figurehead caliphate with it, broke out among the various local rulers and the Turkish military chiefs, which would end in 946 with the victory of the Buyids.