Medieval royal chronicles legitimized current rule by legitimately descended dynasties

Evidence

Alfonso X seems to have closely supervised the creation of the Estoria de España (often known as the Primera crónica general). Most of the text (or most of that part of it that was actually composed under Alfonso) deals with Roman and Visigothic history. Alfonso apparently meant it to strengthen his claim to the imperial crown; it is probably no coincidence that he abandons the Estoria at the same time as he gives up his claim to the title of Roman emperor. The Estoria’s vision of history justifies Alfonso’s supremacy as Gothic king and Roman emperor; its objective is to trace the history of Spain “from Noah’s time to our own.” It narrates the different dynasties that ruled Spain: Greeks, Carthaginians, Romans, Vandals, Visigoths, and Arabs. Only two of these groups are legitimate: the Romans and the Visigoths; Alfonso, king and emperor, is legitimate successor to both. The others are illegitimate interlopers—in particular the invaders from Africa, Carthaginians and Moors. — John V. Tolan, Saracens, 967