The fortunes of Austria never seemed brighter than in 1628 when Wallenstein began the siege of Stralsund. The Swedish and French intervention. His failure, followed by the arrival of Gustavus Adolphus in Germany in 1630, proved the death blow of Austrian hopes. In 1632 Gustavus Adolphus was killed, in 1634 Wallenstein was assassinated, and in 1635 France entered into the war. The Thirty Years' War now ceased to be a religious struggle between Catholicism and Protestantism; it resolved itself into a return to the old political strife between France and the Habsburgs. The peace of Westphalia, 1648. Till 1648 the Bourbon and Habsburg powers continued the war, and at the peace of Westphalia Austria suffered severe losses. Ferdinand III. (1637-1657) was forced to yield Alsace to France, to grant territorial supremacy, including the right of making alliances, to the states of the Empire, and to acknowledge the concurrent jurisdiction of the imperial chamber and the Aulic council. The disintegration of the Holy Roman Empire was now practically accomplished, and though the possession of the imperial dignity continued to give the rulers of Austria prestige, the Habsburgs henceforward devoted themselves to their Austrian interests rather than to those of the Empire.

In 1657 Leopold I., who had already ruled the Austrian Leopold I. dominions for two years, succeeded his father Ferdinand and was crowned emperor in the following year. His long reign of 48 years was of great importance for Austria, as determining both the internal character and the external policy of the monarchy. The long struggle with France to which the ambitions of Louis XIV. gave rise, and which culminated in the War of Spanish Succession, belongs less to the history of Austria proper than to that of Germany and of Europe. Wars with Turkey. Of more importance to Austria itself was the war with Sweden (1657-60) which resulted in the peace of Oliva, by which the independence of Poland was secured and the frontier of Hungary safeguarded, and the campaigns against the Turks (1662-64 and 1683-99), by which the Ottoman power was driven from Hungary, and the Austrian attitude towards Turkey and the Slav peoples of the Balkans determined for a century to come. The first war, due to Ottoman aggression in Transylvania, ended with Montecuculi's victory over the grand vizier at St Gothard on the Raab on the 1st of August 1664. The general political situation prevented Leopold from taking full advantage of this, and the peace of Vasvár (August 10) left the Turks in possession of Nagyvarad (Grosswardein) and the fortress of érsekujvár (Neuhäusel), Transylvania being recognized as an independent principality.

The next Turkish war was the direct outcome of Leopold's policy in Hungary, where the persecution of the Protestants and the suppression of the constitution in 1658, led to a widespread conspiracy. This was mercilessly suppressed; and though after a period of arbitrary government (1672-1679), the palatinate and the constitution, with certain concessions to the Protestants, were restored, the discontent continued. In 1683, invited by Hungarian malcontents and spurred on by Louis XIV., the Turks burst into Hungary, overran the country and appeared before the walls of Vienna. The victory of the 12th of September, gained over the Turks by John Sobieski (see John III. Sobieski, King of Poland) not only saved the Austrian capital, but was the first of a series of successes which drove the Turks permanently beyond the Danube, and established the power of Austria in the East. The victories of Charles of Lorraine at Párkány (1683) and Esztergom (Gran) (1685) were followed by the capture of Budapest (1686) and the defeat of the Ottomans at Mohács (1688). In 1688 the elector took Belgrade; in 1691 Louis William I. of Baden won the battle of Slankamen, and on the 11th of September 1697 Prince Eugene gained the crowning victory of Zenta. This was followed, on the 26th of January 1699, by the peace of Karlowitz, by which Slavonia, Transylvania and all Hungary, except the banat of Temesvár, were ceded to the Austrian crown.

Leopold had wisely decided to initiate a conciliatory policy in Hungary. At the diet of Pressburg (1687-1688) the Hungarian crown had been made hereditary in the house of Habsburg, and the crown prince Joseph had been crowned hereditary king of Hungary (q.v.). In 1697 Transylvania was united to the Hungarian monarchy. A further fact of great prospective importance was the immigration, after an abortive rising against the Turks, of some 30,000 Slav and Albanian families into Slavonia and southern Hungary, where they were granted by the emperor Leopold a certain autonomy and the recognition of the Orthodox religion.

By the conquest of Hungary and Transylvania Leopold completed the edifice of the Austrian monarchy, of which the foundations had been laid by Ferdinand I. in 1526. He had also done much for its internal consolidation. By the death of the archduke Sigismund in 1665 he not only gained Tirol, but a considerable sum of money, which he used to buy back the Silesian principalities of Oppeln and Ratibor, pledged by Ferdinand III. to the Poles. In the administration of his dominions, too, Leopold succeeded in strengthening the authority of the central government. The old estates, indeed, survived; but the emperor kept the effective power in his own hands, and to his reign are traceable the first beginnings of that system of centralized bureaucracy which was established under Maria Theresa and survived, for better or for worse, till the revolution of 1848. It was under Leopold, also, that the Austrian standing army was established in spite of much opposition; the regiments raised in 1672 were never disbanded. For the intellectual life of the country Leopold did much. In spite of his intolerant attitude towards religious dissent, he proved himself an enlightened patron of learning.