Empire was a Habsburg, with only one exception.
The Habsburgs began also to accumulate lands far from the hereditary lands. In 1477 Archduke Maximilian, only son of Emperor Frederick III, married the heiress Maria of Burgundy, thus acquiring most of the Netherlands for the family. His son Philip the Fair married Joanna the Mad, the heiress of Castile and Aragon, and thus acquired Spain and its Italian, African and New World appendages for the Habsburgs. In 1526 following the Battle of Mohács, Bohemia and the part of Hungary not occupied by the Ottomans came under Austrian rule. Ottoman expansion into Hungary led to frequent conflicts between the two empires, particularly evident in the so-called Long War of 1593 to 1606. The Turks made incursions into Styria nearly twenty times; burning, pillaging, and taking thousands of slaves.
During the long reign of Leopold I (1657–1705) and following the successful defense of Vienna in 1683 (under the command of the King of Poland, John III Sobieski), a series of campaigns resulted in bringing all of Hungary to Austrian control by the Treaty of Karlowitz in 1699.
Emperor Charles VI relinquished many of the fairly impressive gains the empire made in the previous years, largely due to his apprehensions at the imminent extinction of the House of Habsburg. Charles was willing to offer concrete advantages in territory and authority in exchange for other powers' worthless recognitions of the Pragmatic Sanction that made his daughter Maria Theresa his heir. With the rise of Prussia the Austrian–Prussian dualism began in Germany. Austria participated, together with Prussia and Russia, in the first and the third of the three Partitions of Poland (in 1772 and 1795).
Austria later became engaged in a war with Revolutionary France, at the beginning highly unsuccessful, with successive defeats at the hands of Napoleon meaning the end of the old Holy Roman Empire in 1806. Two years earlier, in 1804, the