Yasui-konpiragu Shrine (安井金比羅宮) origins supposedly go back to the 7th century and a temple called Fujidera.
This temple was favored by the Emperor Sutoku (1119-1164), who was exiled to what is now Kagawa Prefecture in Shikoku after a war, known as the Hogen Rebellion, over the imperial succession with his younger brother Go-Shirakawa. Sutoku lost, died in exile and was buried on Mt. Shiramine.
Later Sutoku supposedly appeared in a dream to the Buddhist monk Daien, who reported the event to Go-Shirakawa, who ordered the building of another temple Kanshoji to appease the spirit of his older brother.
This temple, in its turn, was destroyed in the Onin War (1467-1477) and was replaced by Rengekoin, a temple originally located in Uzumasa.
The Emperor Sutoku, Omononushi no Kami and the warrior monk and poet Yorimasa Minamoto were all enshrined here. The shrine became known as Yasui-konpiragu during the early Meiji Period of Japanese history under the nationalistically inspired separation of "imported" Buddhism from "native" Shinto, when the name Rengekoin was dropped.