Although the founding date of the shrine is unknown, Hata clan, who was an immigrant clan active in Japan was appointed as textile manufactures Oribeshi by Emperor Ingyo (412-435) They set up Hattori village as their headquarters and established a small sanctuary to Sukunahikona, the divinity of medicine. It is said that at that time, it was a small shrine.
In 901, Sugawara-no-Michizane, demoted to a lower position, was on his way to his new post in Kyushu. Part way at Hattori, he could not walk anymore due to a leg ailment. Villagers recommended him to visit the small sanctuary of Sukunahikonna- no -mikoto in order to cure him.
They told him that ‘a long time ago, Sukunahikona-no-mikoto ruled over the country with Ookuninushi-no-kami. Sukunahikona-no-mikoto established the method of medicine and the way of purifying temporary impurities from living things. Thus, from this time on to the present world, every living thing has existed by the support of these two divinities. I believe that if you show your deep respect to the divinity of Sukunahikona-no-mikoto, your foot and leg condition will become better. Sugawara-no-Michizane who was inspired by such villagers' words visited the small sanctuary of Sukunahikona-no-mikoto.
When he visited the small sanctuary, he caught sight of a nearby sacred stone which is composed of five pieces piled up one upon another. After he had realised that the sacred stone was the sanctuary of Fujiwara-no-Uonakou who died there due to a leg injury, he reflected in his mind ‘Fate of what happened yesterday to the body of others, happens to my body today’. He prayed for the recovery of his leg and paid deep respect to the divinity of Fujiwara-no-Uona.
His leg gradually recovered and he left Hattori and arrived safely at Dazaifu, Kyushu.
After his death, the Tenjin faith, which pays deep respect to Sugawara-no-Michizane as divinity, spread all over the country. Villagers brought the divinity of Sugawara-no-Michizane and set up "Hattori Tenjingu". During the Edo period, many people heard of the reputation to cure and protect people's legs and visited Hattori Tenjingu. Consequently, it has kept up to the present day.