The Holy Roman Empire gradually federalized during the 18th century. The 1790s proved restive after the reign of Joseph II (1780-1790) and his attempts at reform. Francis II (1792-1820) took the throne at only 24, and was much more reactionary than his predecessors. While conservative, Francis proved to be very pragmatic when it came to rule. Josephism remained a powerful force, and Francis allowed limited reforms in the forms of the Criminal Code of 1803 and the Civil Code of 1811. In 1794 a revolutionary plot was discovered, and its leaders arrested and executed. This plot was thought to be inspired by the "French Revolution" (1789-1790), where the absolutist French monarchy accepted a Constitution. This plot was used as an excuse to further repression. Over the next 25 years, under the rule of Francis II, the Holy Roman Empire became a police state, riddled with censorship and suppression.
In foreign policy, the Holy Roman Empire turned towards expansion in the later half of the century. Beginning in 1787, the Holy Romans, allied with Russia under Catherine the Great, went to war with the Ottoman Empire. The war would carry on for over a decade, ending in 1799 with the Austrian capture of Istanbul. In the Treaty of Zurich (signed in neutral Switzerland), the Ottomans ceded the Balkans to the Holy Roman Empire, and Russia consolidated its control over Crimea and the Black Sea. The Holy Romans were also to occupy the western half of Istanbul for a period of 50 years, starting in September, 1799. Thus, the city of Constantino-Istanbul was born, and the eventual seeds of the Great War were sown.
After this exhaustive effort in prosecuting the Second Austro-Russian-Turkish War (1787-1799), the Holy Romans remained neutral in the Second Seven Years' War. In the ensuing decade, Great Britain ceased to be a major power, and Prussia began to assert itself on the continent. Prussia invaded and absorbed the former German states allied to Britain and continued to centralize its government. While the Holy Romans were concerned over this, they consoled themselves with the reminder that they remained in control of the Balkans, and that their empire was the south, not the north.
In 1818, the Franco-Prussian War broke out over Prussian expansion into the Rhineland. Prussia was supported by Saxony and the Netherlands (after a French attempt to create an independent Belgian state). After only a year of war and Prussian victory at the Battle of Niederaussem, the war ended with France's defeat. This meant the Rhineland was annexed by the Empire of Prussia, and Saxony, with Prussian support, declared itself a Kingdom in its own right.
The Franco-Prussian War officially signified Prussia's entry into hall of Europe's great powers. This also meant continued tension between the two Germanic powers: Prussia and the Holy Roman Empire. This tension came to a height at the end of 1819, when in only three successive days, Bavaria, Wurttemburg, and Baden declared their full independence from Francis II's thumb. The new Kingdom of Bavaria, Kingdom of Wurttemburg, and Grand Duchy of Baden had only nominally been controlled by the Holy Romans, and their proclamations of independence were simply stating apparent facts.
Still, this movement was a direct result of Prussian influence. Francis II entertained the idea of going to war with Prussia and the other states in an attempt to reign them in, but quickly decided against it. All of the Holy Roman Empire's might was situated in the Balkans, attempting to occupy them properly. A war on the country's northern border would have immediately meant defeat, especially due to Prussia's only having just defeated France.
On April 6, 1820, Francis II declared through proclamation the dissolution of the Holy Roman Empire. He renounced all claims to Bavaria, Wurttemburg, Baden, and all formerly held Germanic states north of his current control. He also proclaimed himself Francis I, Emperor of Austria, ruler of the Empire of Austria which now ruled all formerly Holy Roman lands that were not renounced. This announcement was applauded throughout Europe as a simple and thoughful decison to avoid war, and Francis I of Austria was praised by all alike for his wisdom. The Holy Roman Empire was now extinct, and the Austrian Empire was now beginning by starting off in the same position as the former.