 In 882, he had already conquered Zaragoza, where attempted to rule independent of Córdoba lord, but faced with constant pressure of the Arab Banu Tujib clan (), he was forced to sell Zaragoza to the emir by 885.Raimon, count of Pallars acted as intermediary in the transfer.After further family disputes, and with the ascendancy of Abd Allah to the throne of Córdoba, Muhammad's pact with the new emir led to his appointment as "wali" of Larida, contrarily to the pretensions that the "wali" of Huesca, Muhammad al-Tawil.