George IV (George Augustus Frederick; 12 August 1762 – 26 June 1830) was King of the United Kingdom of Great Britain and Ireland and King of Hanover from the death of his father, King George III, on 29 January 1820, until his own death ten years later. At the time of his accession to the throne, he was acting as Prince Regent, having done so since 5 February 1811, during his father's final mental illness. George IV was the eldest child of King George III and Queen Charlotte. He led an extravagant lifestyle that contributed to the fashions of the Regency era. He was a patron of new forms of leisure, style and taste. He commissioned John Nash to build the Royal Pavilion in Brighton and remodel Buckingham Palace, and commissioned Jeffry Wyatville to rebuild Windsor Castle. George's charm and culture earned him the title "the first gentleman of England", but his dissolute way of life and poor relationships with his parents and his wife, Caroline of Brunswick, earned him the contempt of the people and dimmed the prestige of the monarchy. He excluded Caroline from his coronation and asked the government to introduce the unpopular Pains and Penalties Bill in an unsuccessful attempt to divorce her. His rule was tarnished by scandal and financial extravagance. His ministers found his behaviour selfish, unreliable and irresponsible, and he was strongly influenced by favourites. During most of George's regency and reign, Lord Liverpool controlled the government as Prime Minister of the United Kingdom. Liverpool's government presided over Britain's ultimate victory over Napoleon and negotiated a peace settlement with the French. After Liverpool's retirement, George IV was forced to accept Catholic emancipation despite opposing it. His only legitimate child, Princess Charlotte, predeceased him in 1817, as did his eldest younger brother Prince Frederick in 1827, so he was succeeded by his second younger brother, William IV, as Frederick had no legitimate children. Early life George was born at St James's Palace, London, on 12 August 1762, the first child of King George III and Charlotte of Mecklenburg-Strelitz. As the eldest son of a British sovereign, he automatically became Duke of Cornwall and Duke of Rothesay at birth; he was created Prince of Wales and Earl of Chester a few days later. On 18 September of the same year, he was baptised by Thomas Secker, Archbishop of Canterbury. His godparents were his maternal uncle