William Frederick, 2nd Duke of Gloucester (1776-1834) was the son of Prince William Henry, 1st Duke of Gloucester (d.1805) and Maria, Countess of Walpole (d.1807). He was born in Rome, and served as Colonel of the 1st Foot Guards in Flanders at eighteen. A year later he was created Major-General, then General in 1808 and Field Marshal in 1816. He served as Chancellor of Cambridge University and later Governor of Portsmouth. He married on 22 July, 1816, at The Queen's House, St James's, his first cousin Princess Mary of Great Britain (1776-1857), fourth daughter of King George III and his wife Queen Charlotte.