Margaret faced a dispute within the family, after four of her grandchildren were stripped of their royal titles.
In Denmark, formal authority rests with the elected parliament and its government. The king is expected to remain above partisan politics, and represent the nation in traditional duties ranging from official visits to national day celebrations.
She ascended the throne on January 15, 1972 after the death of her father. But although she was his eldest child, she did not become heir presumptive until 1953, when Denmark's constitution was amended to allow women to inherit the throne. This came after a referendum in which more than 85% of participants voted in favor of allowing women to succeed.
Margaret was born in 1940, a week after Nazi Germany invaded Denmark, and throughout her life she enjoyed widespread support from Danes, who admired her tactful and creative personality. In addition to regularly shopping, she had a thriving career as an illustrator and designer, and until 2015, defied convention by lighting up cigarettes in public.
She enjoyed a close relationship with Queen Elizabeth II, her third cousin, and both are descendants of Queen Victoria. They have bonded over several official visits to each other's countries over the decades. She also studied in the United Kingdom, spending time at Girton College, University of Cambridge and the London School of Economics.
Danish Prime Minister Mette Frederiksen thanked the Queen for her dedication to her duty throughout her life.
“It is still difficult to understand that now is the time to change the throne,” Frederiksen said in a statement, adding that many Danes have never known another king.
Marie, 51, and Frederick, 55, were seen stepping out alongside their children Prince Christian, 18, Princess Isabella, 16, and Prince Vincent and Princess Josephine, both 12, before attending Marsilisbourg Palace with Margaret on Christmas Day.
Mary had recently returned from a holiday in Australia amid fierce media scrutiny after the prince was accused, in October, of having an affair with Mexican socialite Genoveva Casanova, 47.
The socialite described the rumors as “malicious” while Mary remained silent, as she and her husband adopted a “business as usual” attitude in public appearances.
Get a direct note from our foreigners Reporters About what's making headlines around the world. Subscribe to the weekly What in the World newsletter here.