According to legend, the 28th king of Tibet, Thothori Nyantsen, dreamed of a sacred treasure falling from heaven, which contained a Buddhist sutra, mantras, and religious objects. However, because the Tibetan script had not been invented, the text could not be translated in writing and no one initially knew what was written in it. Buddhism did not take root in Tibet until the reign of Songtsän Gampo, who married two Buddhist princesses, Bhrikuti of Nepal and Wencheng of China. It then gained popularity when Padmasambhāva visited Tibet at the invitation of the 38th Tibetan king, Trisong Deutson.