Sulayman returned to Zaragoza where, in 780, he was killed by his former friend and ally Husayn of Zaragoza. As a result, Matruh became wali of Barcelona and Girona. In 781 the Emir of Córdoba, Abd al-Rahman I, subdued Zaragoza.