Queen Elizabeth II and Prince Philip shared impressive longevity as a married couple going back to their 1947 royal wedding — between then Princess Elizabeth and Lt. Philip Mountbatten, Prince of Denmark and Greece.

But the British royals were actually blood relatives, even though Philip was born into Danish and Greek royalty. Here's how they were related to each other, and how they descended from their common ancestors.

Queen Elizabeth and Prince Philip were related (beyond marriage)

It turns out that the Queen and Duke of Edinburgh were second cousins once removed, as well as third cousins through another relation. In both cases, the ancestors are quite well known. Their closer relation is through King Christian IX of Denmark, while Queen Victoria is the common relative for their third cousinship.

The Danish king was Elizabeth's great-great-grandfather, through the marriage of his daughter, Alexandra, to King Edward VII—Elizabeth's great-grandfather. Christian was also Philip's great-grandfather through his paternal line, making the prince a second cousin once removed of Elizabeth.

How Queen Elizabeth and Prince Philip descend from Queen Victoria

If you're still following, the royals are also both great-great-grandchildren of none other than Queen Victoria. Elizabeth, of course, descends from the royal line of kings who succeeded Victoria, making Victoria her great-great-grandmother (through Edward VII, George V, and her father George VI).

Philip, meanwhile, was the son of Princess Alice of Battenberg. She was the daughter of Princess Victoria of Battenberg, a daughter of Queen Victoria's second daughter, Princess Alice. This connection to Victoria made Elizabeth and Philip third cousins: Both descend from a child of Queen Victoria (Edward and Alice) three generations on.

Below is a photo of Philip's four generations of maternal ancestors: His mother is seated as a baby, along with his grandmother, great-grandmother, and great-great-grandmother, Queen Victoria.

Pinterest
Queen Victoria, Princess Alice, Princess Victoria, and baby Alice, 1900.

So there it is. Queen Elizabeth II and Prince Philip were both second cousins once removed and third cousins, and King Christian IX and Queen Victoria are their closest common ancestors. Intermarriage among various European royal families was quite common in previous centuries, leading to many interconnected and distantly-related rulers and royals.