Sofia Magdalena av Danmark was born on 3 July 1746 in Copenhagen, the daughter of the Danish king Frederick V and Louise of Great Britain. As early as 1751, when she and the Swedish crown prince Gustav were both five, a betrothal was arranged to bind the two kingdoms closer together. The wedding first took place by proxy in Copenhagen on 1 October 1766, and on 4 November that year the couple were married in the chapel of the Royal Palace in Stockholm. She became queen on 12 February 1771 and was crowned in Storkyrkan on 29 May 1772.
Her marriage to Gustav III was unhappy, marked for long stretches by coldness and distance. On 1 November 1778 her son Gustav Adolf, later Gustav IV Adolf, was born, and in August 1782 a second son, Karl Gustav, who died in March 1783. At court she attended festivities, ceremonies and theatre performances, and her splendid state bedchamber at the Royal Palace, today the Svea Salon, was finished in 1778. She built up a large library, had a lifelong interest in theatre and opera, and gave generously to charity.
As dowager queen she withdrew more and more, living at Ulriksdal Palace, which she obtained in 1808 in exchange for Strömsholm. In May 1813 she suffered a stroke, and she died at Ulriksdal on 21 August 1813. She rests in the Gustavian burial chapel of Riddarholmskyrkan.
