He studied the doctrines of Tendai under Saicho at Mount Hiei and later assisted his master in managing the temples there.
After setting up a new code for temples he became a disciple of Kukai under whom he studied esoteric Buddhism at Mount Takao, west of Kyoto, until he came to be regarded as one of the 10 most distinguished disciples of Kukai. Later he assisted Kukai in founding the Kongobuji Temple on Mount Koya.