In 901, when Michizane was exiled to Dazaifu (the governmental office in Chikuzen Province), Genzo TAKEBE, the prefectural governor of Sonobe, who was asked to bring up Michizane's eighth son, Keno gimi, built a small shrine on his premises in Komugiyama to secretly enshrine an image of Michizane as seishi (the enshrining of a living person), and this is considered to be the origin of this shrine.
延喜元年（901年）に道真が大宰府に流された時、園部の代官・武部源蔵は道真の八男・慶能君の養育を頼まれ、小麦山にあった邸内にに小祠を作り、密かに道真の像を安置して生祠として奉斎したのが当社の始まりとする。