Under Sultan Selim I (1512-1520), the Ottomans defeated the Safavids in the Battle of Chaldiran (1514). His successor, Suleiman the Magnificent (1520-1566), the Ottoman Empire marked the peak of its power and prosperity as well as the highest development of its government, social, and economic systems. Already controlling the Balkans, it was able to invade Hungary and win in the Battle of Mohács (1526). However, further advancement failed after the Siege of Vienna (1529). Following naval victories in the Battle of Preveza (1538) and the Battle of Djerba (1560), the Ottomans also emerged as the dominant maritime power in the Mediterranean. A sailing voyage even reached the Aceh Sultanate in 1565. At the beginning of the 17th century, the empire contained 32 provinces and numerous vassal states. Some of these were later absorbed into the Ottoman Empire, while others were granted various types of autonomy over the course of centuries.