In 838, however, during Mu'tasim's great campaign against the Byzantine city of Amorium, Ujayf fell out with the caliph over the provisioning of the army; to this were added other perceived slights, and Ujayf and his followers began to conspire against the caliph. Ujayf was probably a leading member of a powerful group within the Abbasid military establishment that already back in 833 had opposed Mu'tasim's accession, and had favoured his nephew, Ma'mun's son al-Abbas. The agitation then had only subsided after Abbas himself swore allegiance to his uncle, but now a conspiracy was formed to kill Mu'tasim as well as his top Turkish commanders, al-Afshin and Ashinas. The plot was uncovered, however, and the ringleaders were arrested, with Ujayf being executed.