The origins of modern-day Austria date back to the time of the Habsburg dynasty when the vast majority of the country was a part of the Holy Roman Empire. From the time of the Reformation, many Northern German princes, resenting the authority of the Emperor, used Protestantism as a flag of rebellion. The Thirty Years War, the influence of the Kingdom of Sweden and Kingdom of France, the rise of the Kingdom of Prussia, and the Napoleonic invasions all weakened the power of the Emperor in the North of Germany, but in the South, and in non-German areas of the Empire, the Emperor and Catholicism maintained control. During the 17th and 18th centuries, Austria was able to retain its position as one of the great powers of Europe[12][13] and, in response to the coronation of Napoleon as the Emperor of the French, the Austrian Empire was officially proclaimed in 1804. Following Napoleon's defeat, Prussia emerged as Austria's chief competitor for rule of a larger Germany. Austria's defeat by Prussia at the Battle of Königgrätz, during the Austro-Prussian War of 1866 cleared the way for Prussia to assert control over the rest of Germany. In 1867, the empire was reformed into Austria-Hungary. After the defeat of France in the 1870 Franco-Prussian War, Austria was left out of the formation of a new German Empire, although in the following decades its politics, and its foreign policy, increasingly converged with those of the Prussian-led Empire. During the 1914 July Crisis that followed the assassination of Archduke Franz Ferdinand of Austria, Germany guided Austria in issuing the ultimatum to Serbia that led to the declaration of World War I.