Khaqani may have been a child prodigy, since several of his poems can be dated to his early youth, indicating that he had become the eulogist of Manuchihr III at an early age. In his early youth, Khaqani wrote under the pen name "Haqaiʿqi" ("Seeker"). The Shirvanshahs bore the title "Khaqan", from which he later derived the pen name, "Khaqani" ("regal"). Some traditional stories describe him as being the pupil and son-in-law of the famed poet Abul-Ala Ganjavi, however, this is not corroborated by Khaqani's own writings.