Kyoto boasts two prominent mountains in its environs. To the north-east, guarding the devil’s gate (kimon), is Mt Hiei, 848 meters tall. Its guardian shrine is Hiyoshi Taisha, and as the ‘mother of Japanese Buddhism’ it stands at the very centre of the country’s religious history.
Over to the west of the city stands the less well-known Mt Atago, actually the taller of the twin peaks (924 m). Its guardian shrine is Atago Jinja, head of some 900 Atago shrines nationwide. It’s dedicated to Atago Gongen, a syncretic deity which protects the city from fire, and once a year it is the scene of a mass pilgrimage. According to Samborn Brown on his website cyclekyoto,
On the night of July 31, Mount Atago witnesses a huge number of pilgrims. On that night, from roughly 9 pm, Mount Atago plays host to “Sennichi Tsuyasai,” a festival that is all about fire, both good and bad. It is a holy and profound and magical night not to be missed.”The origin of the festival derives from the hope for a thousand days of flame (cooking, heating), and also for a thousand days without home-wrecking fire. From top to bottom, the hike is roughly four kilometers.”
The following extract by Sanborn Brown comes from the e-book, Deep Kyoto: Walks (available on amazon here).
The mountain was once the border between the former Yamashiro and Tamba kingdoms, independent fiefdoms that vied for power in this part of Kyoto in the pre-Tokugawa period. Prior to that, the first religious site on the mountain was built by a priest called Taicho. At the beginning of the eighth century C.E., he climbed the mountain, cleared an area, and founded a temple. Hakuunji, or White Cloud Temple, was the result of his labor.
For centuries worshippers came to Hakuunji to pray for luck in war, as the temple was home to the patron saint of victory in battle. As a result, generals during the Warring States Period  including the great Akechi Mitsuhide and Date Masamune and, later, Oda Nobunaga  himself – prayed at the temple.
Change however was afoot in the 19th century, for both Japan and the temple. Before Japan was pried open to the outside world in the mid-19th century, Buddhism and Shintoism were often commingled at shrines and temples throughout the country. However, in 1868, the newly minted Meiji government mandated that Buddhist temples and Shinto shrines be separated under the tenet of shinbutsu bunri (“separation of kami and Buddhas”). What remains today at Atago is a shrine, one of more than 900 Atago shrines in Japan and of which Kyoto is the head.
At this time, according to Bukkyo University professor Yagi Toru, who has written extensively on Mt. Atago and its history and culture , Hakuunji was converted into Atago Shrine. In so doing, the Jizo statue devoted to success in battle was relocated to Konzoji Temple in Ohara, in the far north of Kyoto. In its place, fire became the focus of the pilgrimage, and instead of warriors the common people became the primary pilgrims.
The shrine on Mt. Atago was dedicated to Izanami and her child Kagutsuchi, the god of fire. In Japanese mythology, the female Izanami, in union with the male Izanagi, created the eight great islands of Japan. In this creation story, Izanami, alas, died giving birth to Kagutsuchi because of burns she incurred. Her death infuriated Izanagi, who thereupon slew the infant by beheading him. According to one source for the myth, Izanami, close to death, also gave birth to the water goddess Mizuhame, and instructed her to pacify Kagutsuchi, that fire must be appeased.
The Sennichi Tsuyusai festival in its current form dates to the 1860s and has its roots in fire: in the double-edged prayer for a thousand days of flame for cooking and heating; and, conversely, a thousand days free of home-wrecking fire. The festival thus joins three of Kyoto’s best-known festivals of fire – Okera Mairi, at Yasaka Shrine on New Year’s Eve; the mountain bonfires of Daimonji (Japan’s All Souls Night in August); and the Kurama Fire Festival, in October.
In the not so distant past, in which homes were constructed of paper, wood, and thatched roofs; in which the hearth was the center of the home, and both fed and heated all therein; in which the nightly bath was heated by firewood and kindling; in which pests were driven from fields by fires lit by villagers – fire was a fearsome and divine and daily part of life…
[To read the rest of this extract, download the e-book here: Deep Kyoto: Walks.]
 The Warring States Period was a time of near constant military conflict from the middle of the 15th century until the beginning of the 17th century.
 Akechi Mistuhide, 1528 – 1582, was a general of Oda Nobunaga most famouse for betraying him. Date Masamune, 1567 – 1636, was a legendary warrior and founder of modern Sendai city, he was nicknamed the “one-eyed dragon”. Oda Nobunaga, 1534 – 1582, was the warlord who initiated the unification of Japan at the end of the Warring States Period.
 See: Yagi, Toru, Hi o Meguru Minzoku Shinyoku (The Connection Between Fire and Folk Belief). Bukkyo University Kiyo Magazine, Issue 104, August 2006. Yagi, Toru, Atagosan To Atago Mairi (Mount Atago and the Atago Pilgrimage). Kyoto: Bukkyo University Press, 2004.