The following is respectfully quoted from “The History of the Nyingma School of Tibetan Buddhism” by Dudjom Rinpoche:
He studied all the sūtras, tantras, and sciences under the many scholars and accomplished masters of India, of whom the foremost were: the eight great awareness-holders, from whom he received the Eight Classes of Means for Attainment; Buddhaguhya, from whom he received the Magical Net; and Śri Simha, from whom he received the Great Perfection. Training himself thus, he fully understood all doctrines after studying them only once. He could see the deities even without propitiating them. In this way, he became renowned as Loden Chokse (Intelligent Boon-seeker), and he demonstrated the ultimate attainment of a holder of the awareness of spiritual maturation.
Then he gained influence over Mandāravā, the daughter of King Ārsadhara of Sahor, who possessed marks of a dākinī. He took her to the Māratika Cave, to serve as the consort for his practice; and for three months they practised the means for attainment of longevity. Lord Amitāyus actually came there and empowered them, and he consecrated them to be no different than himself. He granted them one billion rites of longevity, whereby Padmasambhava attained the accomplishment of awareness-holder endowed with power over the duration of his life.
Having thus attained the body of indestructible reality that is beyond birth and death, Padmasambhava went to subdue the kingdom of Sahor. When the king and his ministers tried to immolate him, he performed the miracle [of transforming the pyre into] a lake of sesame oil, in the midst of which he remained seated on a lotus. Thus he secured them in faith and introduced them all to the doctrine, so that they reached the level of no-return.
Guru Padma Siddhi Hum.