Heroic Islamic history writing doubled as deliberate ruler-serving propaganda.
Evidence
What is the purpose of this heroic literature? It is meant to stimulate, arouse, encourage, stiffen the sinews and summon up the blood, in Shakespeare’s phrase. It also has some other purposes which become more important in later times. For want of a better term, I would call this purpose PR, public relations. This becomes almost formalized and certainly becomes a profession. Historical PR comes in a number of forms. The most universal is the poem. — Bernard Lewis, From Babel to Dragomans, 1931