Prussia, a rising power, struggled with Austria for dominance within and outside the Holy Roman Empire in central Europe. In 1756, the four greatest powers "switched partners" so that Great Britain and Prussia were allied against France and Austria. Realizing that war was imminent, Prussia pre-emptively struck Saxony and quickly overran it. The result caused uproar across Europe. Because of Austria's alliance with France to recapture Silesia, which had been lost in the War of the Austrian Succession, Prussia formed an alliance with Britain. Reluctantly, by following the Imperial diet of the Holy Roman Empire, which declared war on Prussia on 17 January 1757, most of the states of the empire joined Austria's cause. The Anglo-Prussian alliance was joined by a few smaller German states within the empire (most notably the Electorate of Hanover but also Brunswick and Hesse-Kassel). Sweden, seeking to regain Pomerania (most of which had been lost to Prussia in previous wars) joined the coalition, seeing its chance when all the major continental powers of Europe opposed Prussia. Spain, bound by the Pacte de Famille, intervened on behalf of France and together they launched an unsuccessful invasion of Portugal in 1762. The Russian Empire was originally aligned with Austria, fearing Prussia's ambition on the Polish–Lithuanian Commonwealth, but switched sides upon the succession of Tsar Peter III in 1762.