Every legend needs a beginning, and this one starts with a dream. The tale is set at the end of the Heian period, when Kamakura was troubled by disorder and disasters. In the year 1185, the first Kamakura shogun, Minamoto no Yoritomo, is said to have received a message in his sleep from the deity Ugafuku-jin. The story gives the timing with great precision. The dream came in a snake year, in the snake month, on the snake day, at the snake hour. The deity told him to honor the gods and buddhas with the water that wells up in this place, and promised that peace would come to the land. Yoritomo searched, found a spring in the rock wall of Sasukegayatsu, hollowed out a cave and built a shrine to enshrine the deity. That is the origin story told for this shrine, and it is a legend, not a documented event. The deity itself is striking. Ugafuku-jin is a water god with a human head and the body of a snake, which fits a shrine built around a spring. Some versions add that Yoritomo prayed for relief for the poor, and that the turmoil then calmed.