Shinsenen (神泉苑) is a Shingon Japanese Buddhist temple located south of Nijō Castle in the approximate center of the modern city of Kyoto, Honshu, Japan.
[1] First built in the year 794, the site was originally connected to the Heian Palace of that time and was used as a private garden for the Emperor.
In 863 a plague extended throughout the city and a sacred ritual to appease the angry spirits was held.
Later, a total of 66 pikes (representing the regions of Japan of that time) were erected on the south end of the Shinsenen, Mikoshi from the Gion-jinja (today's Yasaka Shrine) were brought in and a ritual was conducted.
[3] Over the years this became a local festival and the pikes were mounted on decorated carts, which is said to be the origin of the modern day Gion Matsuri.