The family tree of the Habsburgs, a German-Austrian ruling family whose domain stretched from Portugal to Transylvania, is a tangled one. Like many royal families, the Habsburgs made strategic marriages to consolidate their power, often to close relatives. And while the dynasty’s regalia was glittery and their palaces splendid, the royals themselves were markedly less easy on the eyes: Generation after generation, Habsburg monarchs had sharply jutting jaws, bulbous lower lips and long noses. This distinctive “Habsburg jaw,” a new analysis published in the Annals of Human Biology finds, most likely resulted from inbreeding.

The researchers, led by geneticist Román Vilas from Spain’s University of Santiago de Compostela, focused on 15 members of the so-called Spanish Habsburgs. While the Habsburg family rose to power in central Europe as the rulers of Austria, Germany and eventually the Holy Roman Empire, the family’s influence spread westward to Spain after Philip I, son of the second Habsburg Holy Roman Emperor, married Joan of Castile in 1496. The Spanish Habsburgs’ reign lasted two centuries, until the 38-year-old Charles II, a king whose manifold health woes and infertility scholars often attribute to severe inbreeding, died in 1700 with no immediate heir.

Vilas and his colleagues honed in on Spanish Habsburgs whose appearances artists—including notables like Diego Velázquez—had documented in photorealistic portraits. Using an extensive family tree spanning 20-plus generations, the scientists determined that the average inbreeding coefficient of the Habsburgs they analyzed was .093. This means that roughly 9 percent of a given royal’s corresponding genes (one maternal, one paternal) were identical because they came from the same ancestor, according to Ed Yong of National Geographic. (Comparatively, the child of two first cousins would have an inbreeding coefficient of .0625, and the child of two third cousins, like England’s Prince Charles, would have an inbreeding coefficient of .004.)

In addition to quantifying how inbred each aristocrat was, the researchers asked mouth and jaw surgeons to look at the portraits and determine how many abnormal facial features typical of mandibular prognathism (MP, or protruding jaw) and maxillary deficiency (sunken midface) each Habsburg possessed. Higher scores indicated stronger occurrence of dysmorphic features.

Vilas’ team found that unfortunate-looking Habsburgs with high MP scores—that signature “Habsburg jaw” —were more likely to have a high inbreeding coefficient. In fact, differences in levels of inbreeding accounted for 22 percent of the differing severity of mandibular prognathism among the Habsburgs studied.

Philip IV, Charles I and Charles II each exhibited about five of the seven tell-tale features of MP—more than any of their other relatives included in the study. Charles I, also known as Holy Roman Emperor Charles V, possessed “a long, cadaverous face and a lopsided mouth (which drops open when he is not on his guard),” wrote Italian diplomat Antonio di Beatis in 1517. Although he had a relatively low (for his family) inbreeding coefficient of .038, the genetic impact of intermarriage increased with subsequent generations.

“El Hechizado,” or “the bewitched,” as Charles II was dubbed for his overlarge tongue, epilepsy and other illnesses, had a whopping inbreeding coefficient of .25, about the same as the offspring of two siblings. (Charles’ mother and father were, in fact, niece and uncle, so this higher value indicates his parents were substantially inbred themselves.) Four years before Charles’ death, British envoy Alexander Stanhope described the king’s Habsburg features in a letter to the Duke of Shrewsbury, writing, “He has a ravenous stomach, and swallows all he eats whole, for his nether jaw stands so much out, that his two rows of teeth cannot meet.”

Based on this correlation between the level of inbreeding and MP, Vilas’ team suggests that the Habsburg jaw was caused by a recessive gene. Recessive genes only manifest as a noticeable phenotype when both of an individual’s two copies of a gene are the same, so the duplicate genes passed down through inbreeding make a recessive trait statistically more likely to surface. This finding stands in contrast to the previous belief that a dominant gene influenced the Habsburg’s distinctive looks. Still, the scientists acknowledge that they can’t completely disregard an alternate hypothesis—that random buildup of genetic changes, not inbreeding, resulted in the increasing frequency of “Habsburg jaw”—although they view the possibility as “unlikely.”

The Habsburgs’ ungainly facial features weren’t the only negative side effect of inbreeding: University of Santiago de Compostela geneticists previously found that inbreeding diminished Habsburg offspring’s chances of survival by as much as 18 percent. They pinned the “extinction of the dynasty” on two rare, recessive, probably-the-consequence-of-inbreeding disorders Charles II may have had. While marrying relatives may helped the Habsburgs rise to power, the resulting mucked-up family tree eventually led, full circle, to their fall from the throne.