War triggered by the accession of Maria Theresa to the vast Habsburg lands centred on Austria after the death of her father, the Holy Roman Emperor Charles VI. The war involved all of Europe, with France, Prussia, Spain, Bavaria and Saxony arrayed against Austria and Britain, and spread to America, where it swallowed The War of Jenkin's Ear, and was know as King George's War. The first blow was struck by Frederick the Great of Prussia, who attacked Silesia in 1740. He was joined by Charles Albert of Bavaria, elected Holy Roman Emperor Charles VII, who was a rival claimant to the Habsburg lands. In 1741 he invaded Bohemia and occupied Prague. Britain under George II entered the war on Austria's side, fearing a Europe dominated by France. The war now turned, and in 1742 Austria invaded Bavaria, the Prussians withdrew from the war in return for Silessia, and the French were forced into a retreat ended by defeat at the battle of Dettingen (27 June 1743). The war flared up again in 1744, with an alliance of Prussia, France and the Emperor Charles VII against Austria. Charles VII died in 1745, pulling Bavaria out of the war, but the French were victorious at the battle of Fontenoy (11 May 1745), defeating a combined British and Austrian army and in combination with the second Jacobite revolt, ended Britain's direct military intervention on the continent. The war now started to fade away. Maria Theresa's husband Francis was elected Holy Roman Emperor Francis I, and recognized as such by Prussia in the treaty of Dresden (25 December 1745) in return for Austrian recognition of the Prussian occupation of Silesia. The war was finally ended by the Treaty of Aix-le-Chapelle (18 October 1748), which restored all conquered lands apart from Silesia.