Large portions fell under the control of the Ottoman Empire from 1496 to 1878. In the 16th century, Montenegro developed a unique form of autonomy within the Ottoman Empire permitting Montenegrin clans freedom from certain restrictions. Nevertheless, the Montenegrins were disgruntled with Ottoman rule, and in the 17th century, raised numerous rebellions, which culminated in the defeat of the Ottomans in the Great Turkish War at the end of that century.