Thessaloniki was also a Janissary stronghold where novice Janissaries were trained. Mamluk cavalry proved no match for the Ottoman artillery and Janissary infantry. Mahmud II forcibly disbanded the Janissary corps in 1826. The janissary was an ally of Grand Vizier Halil Pasha. In 1622 Sultan Osman II was overthrown in a Janissary uprising. Sultan Mahmud II abolished the "mehter" band in 1826 along with the Janissary corps. Aside from the Janissary infantry, there was also the Sipahi Cavalry. A semi-autonomous Janissary corps was permanently based in Algiers. Uthman Dey, or Kara Osman Dey, was the commander of the Janissary corps in Tunis. The Janissary corps was the only infantry division of the Ottoman army. Ahmed was a Janissary and popular cavalry officer. They were the cavalry equivalent of the Janissary household infantry force. Janissary rebels installed their own government when the Ottoman governor fled. This began after the Ottoman abolition of the Bektashi Janissary Corps in 1826. They killed and otherwise eliminated the Janissary and household cavalry soldiers guarding the State Treasury.