This partially fictional narrative is recorded in Persian and Arabic sources of the early Islamic period, and some of its elements inspired some modern stories. Its general theme has common features with some Greek and Roman legends.