and commoners gathered together, with the former demanding their pay and the latter complaining about how food prices had skyrocketed. Muhammad was able to convince them to temporarily disperse, but riots broke out in the city two days later and it was only with difficulty that they were quelled. Meanwhile, negotiations between Muhammad and Abu Ahmad continued; emissaries were sent by Muhammad to Abu Ahmad's camp, and Samarran prisoners of war were released. Toward the end of December, a provisional agreement between the two sides to depose al-Musta'in was reached, and Abu Ahmad sent five ships loaded with foodstuffs and fodder to relieve the shortages in the city. When the citizens of Baghdad learned that Muhammad had agreed to depose al-Musta'in, they angrily assembled outside his palace. Out of loyalty to al-Musta'in and fears that Muhammad's surrender could result in the Samarrans plundering the city, they attacked the palace gates and fought against the guards. In order to calm the protestors, al-Musta'in appeared above the palace gate with Muhammad at his side, and he gave assurances to the crowd that he was still caliph and that he would lead the Friday prayers the next morning. The following day, December 28, he failed to appear; in response, the houses of Muhammad's subordinates were looted and a large crowd again approached Muhammad's palace, forcing al-Musta'in to make another public appearance. Shortly after this he moved out of Muhammad's palace to another residence in the city, and on January 2, 866, he led the prayer for the Feast of Sacrifice. Muhammad, for his part, strove to convince the people that he was still acting in al-Musta'in's best interests, while at the same time continuing to negotiate with Abu Ahmad regarding the terms of surrender. On January 7, Muhammad and Abu Ahmad met in person under a canopy outside the Shammasiyah gate, and the two men agreed that the state revenues would be split among the parties, with two thirds going to the Turks and one third going to Muhammad and the Baghdadi army, and al-Musta'in should be held liable for part of the soldiers' pay. On the following day, Muhammad went to al-Musta'in and attempted to convince him to abdicate. At first al-Musta'in adamantly refused, but when the Turkish officers Wasif and Bugha stated that they had sided with Muhammad, he agreed to step down. As part of the terms of al-Musta'in's abdication,