The temple was founded as a
Sōtō Zen temple first built in the
Marunouchi area of Tokyo in 1588. It changed location several times, moving to
Yushima Tenman-gū because of the Edo Castle expansion in 1591. Finally in 1657 the
Great fire of Meireki burned down most of the temple and it was moved to the current area in Matsugaya.
 Historically, this area near Asakusa was prone to frequent flooding due to its proximity to the
Sumida River, which would overflow its banks from Edo Bay.
 In the 1800s, a local umbrella and raincoat merchant named Kihachi Kappaya started an effort to create a system to reduce the amount of destructive flooding in the area.
 He invested his own capital to create embankments and a pedestrian bridge.
There are several folktales about the building of this flood reduction setup that included controlled canal water drainage and bridge systems.
 Many tales describe Kihachi receiving assistance to complete this project from a
kappa, the Japanese folklore figure.
 Other tales speak of impoverished samurai who would sell kappa raincoats near the bridge and that soldiers would hang their raincoats to dry near the bridge.
 It is on the site of the bridge in these tales that the current temple is said to be built.
 When Kihachi Kappaya died in 1814 he was buried at the temple, at this point also known as Kappaya Kawataro, another name for kappas and a joke meaning "kappa-selling kappa".