After the death of William IV Mary Adelaide's first cousin, Princess Victoria of Kent, ascended the throne in 1837. However, Salic law prevented Victoria from ascending the throne of Hanover, which instead passed to Prince Ernest Augustus, Duke of Cumberland. Thus, the personal union which had existed for over a century between Britain and Hanover came to an end along with the arrangement of Hanover's ruler living in England as the British monarch and using a viceroy to represent him in Hanover. The Duke of Cumberland moved to Hanover as King and Mary Adelaide's father, no longer needed in Hanover, returned to London with his family, setting up residence in Kensington Palace.