The festival centers around the Shinto god Kanayama-hiko and the goddess Kanayama-hime. The deities are associated with the metallurgic arts and sexual health.
Revelers at the festival traditionally include sex workers seeking protection from disease and in modern times the crowd has grown to include LGBTQ groups seeking sexual blessings and married couples praying for fertility and healthy children.
The Kanayama Shrine now donates proceeds from the festival to research into HIV/AIDS.
The event features phallic imagery reflected in works of art, edible treats, hats, puppets, costumes and a parade of portable shrines bearing sacred penis-shaped objects.
The Kanamara Boat Mikoshi, the first portable shrine in the parade, was donated to the festival by the Hitachi Zosen Corp. and features a black iron phallus on a boat-shaped base.
The second shrine, dubbed Elizabeth Mikoshi, was donated by the Tokyo-based Elizabeth Kaikan crossdressing club. The shrine features a giant phallus on a wooden base and is carried by men dressed as women and women dressed as men.
The Kanamara Mikoshi, the oldest of the portable shrines and the third in the parade, features a wooden phallus housed in a square base with a roof.
The parade is followed by an event known as the "mochi nage," which involves Shinto priests standing on a high scaffold blessing rice cakes and throwing them into the crowd. Catching one of the thrown rice cakes is believed to carry with it a blessing of fertility.
Visitors who venture inside the Kanayama Shrine's exhibition hall can review images, sacred objects and books detailing traditions of sexuality and other festivals around the world dedicated to sex-based deities.
A legend about the Kanayama Shrine's origins as a location for sexual healing involves Kanayama-hiko and Kanayama-hime healing Izanami, a Shinto goddess who suffered severe injuries to the lower half of her body while giving birth to a fire god.
Another legend associated with the festival holds that a local woman's first two marriages were ended prematurely by a sharped-tooth demon inhabiting her sexual organs. The demon was driven off when a blacksmith constructed an iron phallus to break the evil spirit's teeth. An iron penis mounted on a blacksmith's anvil permanently installed in front of the Kanayama Shrine pays tribute to the legend.
During the Edo period, the 1600s through the mid-1800s, prostitutes based out of inns along the Tokaido road from Edo to Kyoto would visit the Kanayama Shrine to pray for protection from sexually transmitted diseases.
The shrine continued to be a popular destination for those suffering from sexually transmitted infections to pray under cover of night during the modern age, leading parishioners at the Kanayama Shrine to hold the first Kanamara Matsuri in 1969 to allow anyone seeking sexually-related blessings from the shrine to do so in the daylight without fear of stigma.
The event's popularity grew in the 1980s, amid the HIV epidemic, and exploded in recent years thanks to tourists being drawn in by photos and videos of the festival posted online. Estimates suggest around 60 percent of the festival's roughly 30,000 revelers in recent years traveled from abroad.
The festival's announcements are now made in both Japanese and English to accommodate tourists.
The Kanamara Matsuri begins Sunday at the Kanayama Shrine.