of Great Britain when Anne, his second cousin, died in August 1714. Great Britain and Hanover remained united in personal union until the accession of Queen Victoria in 1837. George I was followed by his son George II and great-grandson George III. The last mentioned retained the position of elector even after the Holy Roman Empire was abolished by its last emperor in 1806. George III contested the validity of the dissolution of the Empire and maintained separate consular offices and staff for the Electorate of Hanover until the peace conferences at the war's end. After the fall of Napoleon, George III regained his lands plus lands from Prussia as King of Hanover, whilst giving up some other smaller scattered territories. After the Congress of Vienna After the end of the Holy Roman Empire in 1806, Calenberg-Celle and its possessions were added to by the Congress of Vienna ending the Napoleonic war, being born anew under the name of Kingdom of Hanover (including Brunswick-Lüneburg). During the first half of the 19th century, the Kingdom of Hanover was ruled as personal union by the British crown from its creation under George III of the United Kingdom, the last elector of Hanover until the death of William IV in 1837. At that point, the crown of Hanover went to William's younger brother, Ernest, Duke of Cumberland and Teviotdale under the Salic laws requiring the next male heir to inherit, whereas the British throne was inherited by an elder brother's only daughter, Queen Victoria. Subsequently, the kingdom was lost in 1866 by his son George V of Hanover during the Austro-Prussian War when it was annexed by Prussia, and became the Prussian province of Hanover. Duchy of Brunswick The Wolfenbüttel Line retained its independence, except from 1807 to 1813, when it and Hanover were merged into the Napoleonic Kingdom of Westphalia. The Congress of Vienna of 1815 turned it into an independent state under the name Duchy of Brunswick. The Duchy remained independent and joined first the North German Confederation and in 1871 the German Empire. When the main line of descent became extinct in 1884, the German Emperor withheld the rightful heir, the Crown Prince of Hanover, from taking control, instead installing a regent. Decades later, the families were reconciled by the marriage of the Crown Prince's son to the Emperor's only daughter, and the Emperor allowed his son-in-law to assume rule