TOKYO -- A millennium-old temple in Kyoto is offering travelers an exclusive overnight experience for a cool 1 million yen ($9,100), hoping to shore up its dwindling income by capitalizing on the city's booming tourism trade.

Ninna-ji Temple, which dates back to 888, is listed among UNESCO's World Heritage sites. To attract wealthy guests, it has renovated a traditional Japanese-style wooden residence on the grounds, a short walk from the main hall and five-story pagoda -- designated a national treasure and an important cultural property, respectively.

The roughly 160-sq.-meter residence, called Shorinan, had been in disuse for years. Tokyo contractor Sumitomo Forestry took on the 157 million yen renovation project, which included earthquake-proofing, interior redesign and garden landscaping.

The residence opened in May. Only one group can stay per night, and no meals are included. But guests are entitled to exclusive use of the Goten Palace -- historically used by the chief priest as an office -- and can request optional services like a performance of gagaku ancient court music and hands-on ikebana flower arranging.

Ninna-ji holds an important position in Japanese history and religion. Built by Emperor Uda, it saw a number of Imperial family members serve as chief priests, including retired monarchs. Buddhist priest Yoshida Kenko mentioned the temple in "Tsurezuregusa," a collection of essays believed to have been penned between 1330 and 1332, published in English as "Essays on Idleness."

Yet, despite its cultural significance and status as the head of a group of about 800 temples nationwide, Ninna-ji is struggling to make ends meet.

The temple depends on entrance fees collected from visitors, but these revenues have been steadily falling in recent years, even as international tourists visit Japan in droves. Ninna-ji received about 250,000 visitors in 2017, down from 340,000 five years earlier, partly due to major repair work on its Kannon-do hall -- a key attraction.

Ryujun Oishi, who oversees Ninna-ji's accounts, said the monks feel an acute sense of crisis.

"We don't even have enough funds to preserve and repair the cultural assets we have," Oishi said. The temple needs at least 300,000 visitors a year to get by, he added.

Oishi said the decision to offer the pricey accommodation was part of an effort to "preserve our culture, of which Ninna-ji's buildings are a part, and which has been protected by our forebears. We want to ensure they will be handed down to future generations 100, 200 years from now."

He said he hopes the new endeavor will "help boost our name recognition and improve our finances."

See also Where are all the tourists in Japan coming from?

Ninna-ji is not the only religious establishment in Kyoto forced to take unconventional measures for financial reasons. Shimogamo Shrine, a Shinto shrine listed among the same group of World Heritage sites, built a luxury apartment building in its precincts to provide another source of income.

While Kyoto's most popular temples, such as Kiyomizu-dera and Kinkaku-ji, are consistently crowded with tourists, quite a few others may be missing out on the tourism rush, according to Kokugakuin University professor Kenji Ishii.

"Repair expenses and labor costs are rising," said the Shinto scholar, who serves as director of the Japanese Association of Religious Organizations. "I think there may be some temples and shrines, even among those in the World Heritage listing, that are facing financial issues."

The challenge for Buddhist temples and Shinto shrines alike is to cash in on the tourism boom while still preserving their heritage.