The Janissaries were a highly formidable military unit in the early years, but as Western Europe modernised its military organisation technology, the Janissaries became a reactionary force that resisted all change. Steadily the Ottoman military power became outdated, but when the Janissaries felt their privileges were being threatened, or outsiders wanted to modernise them, or they might be superseded by the cavalrymen, they rose in rebellion. The rebellions were highly violent on both sides, but by the time the Janissaries were suppressed, it was far too late for Ottoman military power to catch up with the West. The political system was transformed by the destruction of the Janissaries in the Auspicious Incident of 1826, who were a very powerful military/governmental/police force that revolted. Sultan Mahmud II crushed the revolt, executed the leaders, and disbanded the large organisation. That set the stage for a slow process of modernisation of government functions, as the government sought, with mixed success, to adopt the main elements of Western bureaucracy and military technology.