For one day each summer, the hills overlooking the centuries-old Jewish town of Krasnaiya Sloboda in Azerbaijan echo with the sound of wailing women.

The women ascend up a narrow path from this town of several hundred residents in northern Azerbaijan to its vast cemetery. It's an annual procession on Tisha b’Av, the Jewish day of mourning for the destruction of the Temple in Jerusalem.

At the cemetery, each woman sits next to a loved one’s grave – usually a husband or child, but sometimes a parent or sibling. She sings mournfully for hours in Juhuri, a dying Jewish language made up of Farsi and Hebrew with Aramaic and Turkic influences that is spoken only by the Mountain Jews of the Caucasus.

Hundreds perform the ritual each year; some travel halfway across the world to attend. It is a testament to how Krasnaiya Sloboda’s Mountain Jews have endured for about a millennium since Persian Jews established the town with the blessing of a local Muslim ruler.

Next year, the community hopes to strengthen its sense of identity even further with the opening in town of a multimillion-dollar Mountain Jews museum. Spearheaded by a wealthy expatriate living in Moscow, the museum will feature artifacts collected from throughout the Caucasus, including ritual objects, documents and other evidence of the Jewish life that thrived here for centuries on the border between Europe and Asia.

But amid growing emigration by Jews from the rural and impoverished area, some locals and experts on the community fear for its long-term viability and that of its language -- and that the museum will be less a living tribute than a memorial.

“The demographic trajectory isn’t promising,” said Chen Bram, an anthropologist from Hebrew University and Hadassah Academic College who has researched Mountain Jews for decades. “I hope this new museum doesn’t eventually become a monument for an extinct community" in Krasnaiya Sloboda.

Estimates as to how many Jews are living in Krasnaiya Sloboda range from 500 to 1,200. Thousands have left for Moscow, Israel, Germany and the United States. An exact figure is difficult to ascertain because many people who are registered as residents -- meaning they own assets here -- live outside the town.

“There are virtually no sources of employment, it’s a graying community and its long-term viability is uncertain,” Bram said.

He says the Tisha b’Av tradition gives the community “a lot of strength,” but it’s not enough to counterbalance the effects of a major depletion in the ranks of the community that had 8,000 members 30 years ago.

“Visit after Tisha b’Av and the High Holy Days," Bram said, "and sadly you’ll see a ghost town.”

That hardly seems the case in the days around Tisha b’Av. In the town’s four Jewish-owned cafes, dozens of Jewish men play backgammon while sipping strong black tea from small glass cups, filtering the hot liquid through a sugar cube clenched between their front teeth.

On Tisha b'Av itself, which this year fell on July 22, the main Seven Dome Synagogue, which is located around the corner from the new museum, is packed with male worshippers.

They had gathered at the square in front of the 19th-century wooden shul and chatted while waiting for the caretaker to open the building. Then they removed their shoes and stepped barefoot into the carpeted interior -- a custom that resembles the behavior of Muslims at a mosque. Many believe it comes as a result of centuries of coexistence in Azerbaijan, a majority Shiite country.

Another similarity is the absence of women. As with many mosques across the Muslim world, women are welcome in synagogue here only on special occasions, according to the community’s rabbi, Tsadok Ashurov. His Orthodox synagogue doesn’t even have a women’s section.

At around noon on Tisha b’Av, the men leave the synagogue, reunite with female relatives and ascend the mountain to the cemetery, where the women assume the central role.

As they wail, the men stand silently in the scorching sun at a respectful distance. Some women thump their chests repeatedly while weeping in a trance-like lament called "girye" in Juhuri over the graves of relatives who died decades ago.

Among the hundreds of visitors are mourners who traveled from their homes in Russia, Israel and the United States to visit their relatives’ graves.

“You probably haven’t seen anything like this before,” David Mordechayev, an executive and journalist for STMEGI, the Moscow-based foundation of Mountain Jews, told JTA on the road leading to the cemetery. A sinuous narrow route, it gets so crowded with visitors on the Jewish holy day that a long traffic jam develops there.

To Mordechayev and other activists working to develop Krasnaiya Sloboda’s Jewish heritage, it underscores how Mountain Jews from across the world care passionately about the roots of their distinct group. The community is so old and remote that it predates the Jewish people’s division into Sephardic and Ashkenazi. Mountain Jews have their own language, distinct customs and unique style of reading from the Torah.

This awareness is also behind the construction of the new museum by German Zacharayev, a village native and now one of Russia’s wealthiest individuals. A three-story former synagogue, the museum scheduled to open next year will be the world’s first building devoted to the preservation of Mountain Jews and their culture.

Preserving the heritage has been a longstanding objective for Zacharayev, who founded STMEGI. He has donated millions of dollars toward opening a yeshiva and mikvah, or ritual bath, respectively, in Krasnaiya Sloboda.

He and other expatriates also funnel what in local terms is a fortune toward maintaining urban infrastructure for the community, where most members are low-income pensioners. Krasnaiya Sloboda has paved roads and a storm-proof electric grid that make for a striking juxtaposition with Quba, the ramshackle Muslim-majority town that lies opposite Krasnaiya Sloboda across the polluted Gudiyalchay River.

Yet despite this help and influx of visitors on Tisha b’Av, Krasnaiya Sloboda’s future is far from certain, according to Bram, the anthropologist.

Take Hanko Nurayev, 72. He returns each year on Tisha b’Av to the house he inherited here from his grandfather, but lives with his family in New York.

“I want to trade this old house for an apartment in New York or Tel Aviv,” he said. “Do you know anyone interested in such a deal?”

Mordechayev is well aware of the depletion and hopes the new museum will draw Israeli and other tourists from Baku, the Azeri capital located about 100 miles away. Tourism from Israel has increased dramatically in Azerbaijan, which has five weekly flights from Israel.

“When we put this place on the touristic map, dozens of tourists will come here every day,” Mordechayev said. “That’s opportunities for guesthouses, hotels, taxi drivers, guides. It’ll provide jobs to community members.”

Without employment there is little hope of Krasnaiya Sloboda remaining a Jewish town, said Ashurov, a Mountain Jew from Russia who STMEGI hired in 2016 to serve as the town’s rabbi.

Ashurov runs a yeshiva where he teaches Jewish studies to young boys and girls, “but also extra math and English classes to give them what they need in the world, so they can find employment, be it in Russia or Israel or here,” he said. “That’s the main concern and the main reason the young are leaving this place.”

The town has a shochet, a Jew trained in the kosher slaughter of animals. But many residents shop at local butcher shops, considering halal meat sufficient for their needs. Local Jews are not a very observant bunch, with many of them stepping out of synagogue to make a phone call on Shabbat in violation of traditional customs for the day of rest.

Ashurov replaced Elazar Nisimov, 35, a shochet and yeshiva graduate who served as the town’s rabbi for several years following the retirement of his predecessor. Like thousands of other Mountain Jews, Nisimov now lives in Moscow.

Mordechayev is collecting exhibits for the museum from around the Caucasus. One of them is a 19th-century prayer shawl whose corners feature thick red patches, a modification that allowed it to be used as a huppah, a Jewish wedding canopy.

The museum will also feature a 19th-century horse-drawn carriage and dozens of documents, including ketubot, Jewish wedding contracts.

The collection’s undisputed jewel is the so-called Slashed Book – a disfigured copy of the Bible. According to legend, a Krasnaiya Sloboda rabbi used the book to shield himself from the sword of a Muslim general when the general’s army took over northern Azerbaijan several centuries ago.

“The general was horrified at what he’d done and feared divine retribution, so he let the Jews stay unharmed to atone for his actions,” Mordechayev said, recounting the legend.

The legend around the book goes to the heart of the tradition of mutual respect between Muslims and Jews here. Anti-Semitic incidents are unheard of and men wearing kippot or other Jewish attire attract little to no attention on the street.

Like many of the artifacts that Mordechayev is after, the book was sold to antique dealers at a vastly lower price than its market value. Rabbi Avraham Yisrael Freilich from Israel, who ran Judaica Jerusalem, in the early 2000s sold it to Elia Ilizarov, a Mountain Jew who lives in Russia, for $250,000, according to Mordechayev. Ilizarov agreed to have the book displayed at the museum’s opening; a replica will remain there permanently.

Mordechayev is also collecting Juhuri dictionaries. The new museum aims to build the world’s largest Juhuri library to facilitate research that may allow for the preservation of the language, which is spoken by about 100,000 people worldwide.

There’s a catch, though.

“Juhuri never had an agreed-upon alphabet,” Mordechayev said. Some write it with Cyrillic letters, others use Azeri ones and still others transcribe it in Hebrew letters.

“We hope that concentrating all these books here will facilitate research, digitization and maybe standardization,” he said.

Krasnaiya Sloboda has “an enormous potential for tourism, including educational tourism, not only from Israel,” Bram said. “It’s the world’s last traditional Jewish settlement in a rural area, a kind of last shtetl.”

He said the community's uniqueness can appeal to all denominations of Judaism.

“It can become an important educational center and a must-go destination for world Jewry,” Bram said.

There are preliminary signs that this is already happening. On Tisha b’Av this year, several dozen yeshiva students from Moscow traveled to Krasnaiya Sloboda – the first such visit by a yeshiva in the town’s history.

The visit resonated powerfully with 20-year-old Yisrael Lazar, the son of Russian Chief Rabbi Berel Lazar, who joined the yeshiva students as their counselor.

“For someone like me, who grew up reading about the shtetls and Jewish towns that existed before the Holocaust, this place is simply unbelievable,” he told JTA. “It’s like traveling 100 years back in time.”