In the Heian period, the Shinto priesthood, who adopted Inyo (also referred as Onmyo) gogyo shiso (Yin-Yang Wu-Zing Idea) of Taoism and obtained the idea of Onmyodo (way of Yin and Yang; occult divination system based on the Taoist theory of five elements) and the position of Onmyoji (Master of Ying yang), controlled the administration with a strong power as a bureaucrat.
平安時代には神職が道教の陰陽五行思想を取り込み陰陽道と陰陽師という思想と役職を得て官僚として大きな勢力を持ち執政した。