The Janissary corps were ordered to return to their old customs and traditions in all their affairs, which strengthened his resolve and bolstered his support. He then proceeded to subdue them, and he did so, dressing them in the clothes of humiliation and controlling them. Some of his companions feared for him and warned him of their treachery and deceit, but he paid no heed and was excessive in his severity and threats. When they were cornered and despaired of salvation, they stirred up sedition in the city of Qalbi and openly rebelled. He sent his organized army to fight them, and he was left with only about four thousand men and some other soldiers. He was excessively harsh with the Janissaries in Constantinople. On the night of the twenty-seventh of Ramadan in the year twenty-three, they united and formed factions and marched to the residence of the deposed Sultan Mustafa. They surrounded him and intended to place him on the throne. Mustafa Pasha al-Bayrakdar, with the remaining soldiers, rode against them and fought them fiercely, but he could not repel them. Sensing defeat due to the enemy's numbers, he sent word to the deposed Sultan Mustafa to kill him and ordered his body to be thrown from the top of the palace to the rebels, so that they could not return him to the throne. When they saw the Sultan in this state, their agitation intensified, and their clamor rose. They set fire to the palace of Sultan Mustafa to burn al-Bayrakdar, but rather they set fire to al-Bayrakdar's palace, and they caused destruction, demolition, and looting. Al-Bayrakdar hid in a cellar and was not found. When the fighting between al-Bayrakdar's army and the Janissaries broke out, the admiral of the warships brought three ships into the Bosphorus of Constantinople, aimed their cannons at the Janissaries' residences, and bombarded them with continuous cannonballs. He then disembarked with a contingent of his army and went to the aid of al-Bayrakdar. Ahmed, the commander of the organized armies, also went to his aid, but they were unsuccessful, as the Janissaries had managed to surround the palace. They attacked the Janissaries with swords and captured them from all sides, until they were routed and fled. A group of them descended into people's homes and set them on fire. The flames rose and intensified. The Sultan feared and was horrified by the situation, realizing the destruction of the entire city and the obliteration of its landmarks. He descended from his residence to the gate leading to the sea and called for fighting the Janissaries. They fought them fiercely, and the Janissaries increased their burning of houses and large buildings. The flames poured down like a torrent, consuming most of the city's houses and destroying them. The cries of women and children rose from all sides. People awoke from their sleep in terror. The Sultan shouted and urged the soldiers to fight, and to kill anyone found assisting in the fire. He was, meanwhile, besieged in his palace for a day and a night. When the situation became dire and hopes for the city's salvation weakened, the Sultan sent to the Janissary leaders to negotiate peace. Messengers went back and forth between them, and they ceased the burning and began to extinguish it. A group of Janissaries entered where Mustafa Pasha al-Bayrakdar was, brought him out from under the rubble dead, and hanged him on a tree, mutilating him. The sedition then subsided, and affairs returned to their previous state. The Sultan appointed Vizier Ziya Yusuf Pasha as his vizier, who had come to Egypt to fight the armies of Bona Parte. He suppressed his anger and began to watch for opportunities and discern how to benefit from them.