Denmark has the longest continuous rule by a single family of any European nation, tracing its lineage back to at least Gorm the Old, who reigned in the mid-10th Century. Yet, in all its history, Denmark has been ruled by only two queens. Margrethe I ruled in the 14th Century, Margrethe II has been on the Danish throne since 1972.
Margrethe I was born in 1353 in prison where her mother was confined, possibly for adultery, by her father, Valdemar IV of Denmark. At this time Denmark, Norway, and Sweden were embroiled in a struggle with German princes over control of the Baltic. Marriages, births, depositions, and occasional battles were part of this ongoing struggle. At the age of six Margrethe was betrothed to the Crown Prince of Norway for political reasons which shifted causing the engagement to be cancelled, then shifted again, resulting in Margrethe’s marriage at the age of ten to her original betrothed, Haakon VI, King (then) of both Sweden and Norway. She was raised by a Swedish noblewoman and was more or less an adult by contemporary standards when she finally consummated her marriage. She bore Haakon a son, Olaf, when she was eighteen. By that time Haakon had been ousted as King of Sweden by a German noble from Mecklenburg. Meanwhile, Haakon had a stormy political relationship with his father-in-law that ended with Valdemar’s death in 1375. Margrethe did manage, then, to ensure that her son, Olaf, was named heir to the Danish throne. This was a tricky matter since Margrethe’s elder sister was married to the Duke of Mecklenburg and she also had a son. Valdemar’s only son had died before the throne became vacant and, succession being what it was then, only a male could inherit the crown. Margrethe also pressed for Olaf’s claim to the Swedish crown, a claim that later bore fruit.
In 1380, Haakon died. Margrethe took over as regent for her son, Olaf, now the child-king of both Norway and Denmark. Margrethe proved an adept and popular ruler, taking back some territory held by Germans. In 1387, teen-aged Olaf suddenly died, but Margrethe stayed on as Regent (or one of a number of other titles that were invented to fit her status). Denmark was then aiding the Swedes in removing their unpopular king, Albert of Mecklenburg. The Mecklenburg line had long been a problem for Margrethe, who Albert sneered was “King No-Pants”. The Germans were unhappy about losing Sweden, of course, and a decisive battle was fought in 1389 between Albert of Mecklenburg’s forces and those of Margrethe (which were led by a Mecklenburgian general). Margrethe’s victory made her ruler of Denmark, Norway, and Sweden, which was formalized as the Kalmar, an alliance directed against the German Hanseatic League. Eventually, she was called Queen of Denmark, especially by foreign potentates, such as the Pope, though the title was not exactly official in Denmark itself. Margrethe never re-married but trained an heir from her father’s bloodline. She remains an important monarch of the day, vastly superior to those male kings who were her contemporaries. She died in 1412. Margrethe II was born in 1940, one week after the German invasion of Denmark. Her father, then the Crown Prince, became King Frederick IX in 1947. Frederick had three daughters and no sons. Immediately on taking the crown he began working for constitutional reform that would allow a woman to ascend the throne of Denmark. The Act of Succession passed in 1953 said that women could reign if there were no immediate male heirs. Frederick died in January, 1972, and Margrethe became Queen of Denmark.
The Danish Royals, last April, on the occasion of Margrethe’s 77th birthday. Crown Prince Frederik at far right, Prince Joachim at left, Prince Consort Henrik to Joachim’s right, then the Queen, God bless her. [copyright Getty Images. via dailymail.co.uk]

Tapestry by Nørgaard depicting the marriage of Margrethe and Henrik. Hey! That’s an apple. And a tree! Does this have anything to do with that old anti-feminist myth? You know the one I mean… [via http://www.bjoernnoergaard.dk/en/gobeliner]

Margrethe’s sarcophagus. The base is layers of sandstone, possibly a reference to Henrik’s France. The pillars are stone from Greenland, the Faroes, and Bornholm. Silver elephants. Glass made to look as though someone is there even though they aren’t — Margrethe will be buried in the floor below. The whole thing topped with gilded bronze bric-a-brac. [Photo: Mikkel Møller Jørgensen © Scanpix. via dr.dk]