Kukai, known as Kobosaishi through his posthumous honorific name, sailed to China at the age of 31 in the year 804. In the ancient capital of Chang'an, he studied Tantric Buddhism under priest Keika and was granted a master title. After returning from China in 806, he had been spreading the Shingon (True Word) Sect of Buddhism.
He founded Mt. Koya (Koyasan) as a religious retreat in 816, when the then Emperor Saga granted him the land. It is said that this was the start of Kongobuji Temple.