On 24 May 1837 Victoria turned 18, and the regency was avoided. On 20 June 1837, William IV died from heart failure at the age of 71, and Victoria became Queen of the United Kingdom. In her diary she wrote, "I was awoke at 6 o'clock by Mamma …who told me the Archbishop of Canterbury and Lord Conyngham were here and wished to see me. I got out of bed and went into my sitting-room (only in my dressing gown) and alone, and saw them. Lord Conyngham then acquainted me that my poor Uncle, the King, was no more, and had expired at 12 minutes past 2 this morning, and consequently that I am Queen…" Her coronation took place on 28 June 1838, and she became the first Monarch to take up residence at Buckingham Palace.
Under Salic Law, however, no woman could be heir to the throne of Hanover, a realm which had shared a monarch with Britain since 1714. Hanover passed to her uncle, the Duke of Cumberland and Teviotdale, who became King Ernest Augustus I. (He was the fifth son and eighth child of George III.) As the young queen was as yet unmarried and childless, Ernest Augustus also remained the heir presumptive to the throne of the United Kingdom until Victoria's first child was born in 1840.