Kōzen-ji

Kōzen-ji (光前寺) is a Buddhist temple belonging to the Tendai sect located in the city of Komagane, Nagano, Japan. It is one of the five major Tendai temples in the Shinetsu region of Japan. Its main image is a hibutsu statue of Fudō Myō-ō.

History
The temple claims to have been founded in 860 AD by Honjō Shōnin, a disciple of Ennin; however, as all temple records were lost during the Sengoku period wars between Takeda Katsuyori and Oda Nobutada, there is no documentary evidence to back this claim. The temple enjoyed the support of the Takeda clan, and later that of Toyotomi Hideyoshi and received a 60 koku stipend for its upkeep by Shogun Tokugawa Iemitsu. The temple was much reduced in size during the Meiji period, but many of its surviving structures date from the Edo period:

- Hondō, reconstructed in 1851
 * Sanmon, reconstructed in 1848
 * Kyōzō, built in 1802
 * Benten-dō, built in the Muromachi period, National Important Cultural Property.
 * Three-story Pagoda, reconstructed in 1808,17 meters tall, Nagano Prefectural Important Cultural Property
 * Niōmon, containing Kongōrikishi statues dated 1528, Komagane City Tangible Cultural Property

Hayatarō legend
The temple is one of the sites associated with the Hayatarō Legend (早太郎説話). The story has many variations, but is roughly as follows: Some 700 years ago, at the temple of Kōzen-ji in the remote mountains, a wild mountain dog gave birth to three pups. The priest of the temple took care of the animals, and when the mother dog decided to return to the wilds, she left one of the pups behind out of gratitude to be a guardian of the temple. One day a village child was attacked by a wild animal and the dog rushed to his aid. The dog was then named "Hayatarō", which roughly means "Fast and Brave". Meanwhile, in Mitsuke in neighboring Tōtōmi Province, the farmers suffered greatly from the depredations of some supernatural beast on their fields. Every year, a white arrow was fired at random, and the house nearest to where it landed was forced to make a human sacrifice of one child to prevent this disaster by placing the child in a white box at an abandoned temple. The child disappeared at night and was never seen again. One day, a wandering monk was passing through the village and was very disturbed by this custom, as the gods are benevolent and would never do such an evil thing. He hid behind a tree during the night of the sacrifice and saw some huge monkeys, so old that had become bakemono approach the child singing out "We hope that Hayatarō is not here. Don't let know Hayatarō we are taking the child." The monk fled, and spent several years looking for "Hayatarō" until he came upon Kōzen-ji and its guardian dog. On hearing the tale, the priest let him borrow Hayatarō. At the time of the next sacrifice, Hayatarō was placed in the white box instead of a child. When the monsters came, a great battle ensued. The following morning, the villagers found three dead bakemono, but no Hayatarō. Several days later, Hayatarō returned to Kōzen-ji, but was very injured and died soon after reaching home. The priest made a fine grave for the heroic dog next to the temple's main hall, which remains to this day,

Kōzen-ji gardens
The Japanese garden adjacent to the Main Hall of Kozen-ji has a layout influenced by the Zen master Rankei Dōryū. Believed to date to the Kamakura period, the garden was designated one of the National Places of Scenic Beauty of Japan in 1967. The designation includes the approach to the gardens, with its centuries-old trees, as forming part of the scenic structure of the garden.