SASAYAMA, Hyogo - Daikokuji temple in Sasayama is dubbed the "Shoso-in of the Tanba area" after the repository in Nara that dates back to the eighth century.
Tanba is the area in Hyogo Prefecture where Sasayama is located.
The temple is said to have been opened by a hermit sometime between 645 and 650, during the Asuka period, to pray for the nation's peace and security.
The temple's main hall was built about 700 years ago.
It is a mix of Chinese and Japanese architecture styles, and required the most advanced building techniques of the time.
The building and the temple's five Buddhist statues have been designated as important cultural properties by the central government.
Huge hinoki cypresses greet people who step onto the premises of Daikokuji, which is located in a mountainous area.
The trees are an indicator of the long life the temple has experienced.
Simply standing on such a religious site can help you find a sense of inner peace and an appreciation for the sacred.
However, should you visit the temple over a weekend or during a national holiday, you might wonder where on earth you are.
On such days, this traditional Japanese temple is juxtaposed with a contemporary piece of pop culture.
More and more young cosplayers have been visiting the temple.
They are seeking the unique experience of being photographed in an authentic historical setting while donning the costumes of their favourite anime and video game characters.
On a recent holiday, Daikokuji was visited by two young women who spent a little time in a changing room.
They had transformed themselves into the historical figures Okita Soji and Hijikata Toshizo, senior members of the Shinsengumi samurai warrior force who fought for the Tokugawa shogunate in the tumultuous years leading up to the Meiji Restoration.
The woman playing Okita had golden hair and wore a light blue haori coat - a symbolic item of the force - while the other wore a black kimono and sharp-looking makeup to become Hijikata. Their outfits were inspired by depictions of these historical figures in a popular smartphone game.
The two women sat on the porch of the temple's main hall and posed with props under a tree.
Another woman photographed them.
The cosplayers were overjoyed with the photos, saying they looked cool and that they could not have had a better backdrop.
"The [temple's] historic buildings are perfect with our costumes," said the woman playing Okita.
"It feels amazing to have a photo session in this rich natural environment."
The women posted the images taken that day to a cosplay website that is said to have about 400,000 registered members.
There are many images shot at Daikokuji on the website.
The temple's atmosphere is apparently a good fit with anime and games featuring historical figures.
The temple is popular with cosplayers depicting characters from "Token Ranbu," an online action game that personifies famous samurai swords as male characters; "Ruro ni Kenshin," a manga and anime about a legendary swordsman in the Meiji era; and "Sengoku Basara," another online action game featuring historical figures from the Sengoku warring states period.
Daikokuji began opening its premises as a photo location for cosplayers in 2010.
Chief priest Yuen Sakai said he initially found it puzzling when he received a suggestion for a cosplay project from a video production company in Osaka.
However, the 53-year-old monk eventually decided that accepting cosplayers could be a good idea "if it attracts young people to the temple."
He also cited the aging local community, which has few newcomers.
The project from the Osaka company became known via the internet and through word-of-mouth, and Daikokuji soon received a flood of applications from young people - not only from other parts of the nation, but also from overseas.
The temple has introduced lights for shooting at night and a device that releases smoke.
About 700 people enjoyed cosplaying at Daikokuji in fiscal 2016.
In autumn, as the leaves change colour, the premises are often filled with people portraying anime and game characters alongside participants of sightseeing tours.
Some people might consider Daikokuji's ambitious project sinful for a religious site, but many local residents and supporters of the temple have welcomed the approach, saying it can help them build new ties with young visitors, according to Sakai.
"I believe our Buddha also finds it interesting," the priest added.
Shinya Hashizume, professor of Osaka Prefecture University and an expert on subculture, said he saw cosplayers and sightseers taking photos together when he visited Daikokuji.
"This is an amazing example of coexistence between a religious site and a contemporary hobby," the professor said.
"The temple is nothing less than a sacred site for cosplayers."
Admission to Daikokuji's main hall is ¥800 (S$10) for adults and ¥250 for elementary and junior high school students.
The charge for cosplaying photo sessions is ¥1,500 during the day, ¥2,000 during the evening and ¥3,000 for all day. Reservations are required.
It takes about 70 minutes to drive to the temple from Osaka.
You can also reach the temple by taking the JR limited express Konotori to Sasayamaguchi Station, which takes about 50 minutes, and then taking a taxi for another 10 minutes.