One of the most extraordinary stories in Shanghai's history took place the neighbourhood of Tilanqiao, which served as "a modern-day Noah's Ark" for Jews during WW2.

It is a symbol that looks entirely out of place. In central Shanghai, near the city's nest of gleaming skyscrapers, I spotted a timeworn brick building adorned by a Star of David. This Jewish emblem is small enough that few passers-by would ever notice it. Yet it testifies to of one of the most extraordinary stories in Shanghai's history, which took place here in the neighbourhood of Tilanqiao.

This multicultural oasis was among the very few places Jewish refugees were guaranteed to be accepted

For thousands of desperate people in the 1930s, this Chinese metropolis was a last resort. Most countries and cities on the planet had restricted entry for Jews trying to flee violent persecution by Nazi Germany. Not Shanghai, however. This multicultural oasis – that included British, French, American, Russian and Iraqi residents – was among the very few places Jewish refugees were guaranteed to be accepted, with no visa required.

Despite Shanghai being more than 7,000km from their homes in Germany, Poland and Austria, more than 20,000 stateless Jews fled to China's largest city to escape the Holocaust between 1933 and 1941. Shanghai was not just a safe haven. It was also a modern city with an established community of Russian Jews, who a decade earlier, had built the structure that held that Star of David: the Ohel Moshe Synagogue.

At first, life in Shanghai was peaceful for its newest residents. The Jewish refugees were welcomed by Shanghai residents and they created a strong community with schools and a vibrant social scene. Some refugees began working as dentists and doctors, while others set up shops, cafes and clubs in the neighbourhood.

Shanghai's Jewish ghetto had been born

What the refugees couldn't foresee was they would travel across the globe only to fall into the clutches of the Nazis' most powerful ally. In 1941, Japan seized Shanghai. Acting under instruction from the Nazis, Japanese troops rounded up all of the city's Jews and confined them in Tilanqiao. Shanghai's Jewish ghetto had been born.

This dark history swirled through my mind as I stopped in front of a stone sign in Tilanqiao's Huoshan Park, a small and serene green space with paths that wound through lush vegetation. A group of elderly Chinese men sitting on benches watched me with puzzled expressions as I photographed the plaque. While Tilanqiao's Jewish history does attract a trickle of international visitors, this area remains well off the city's main tourist trail.

As the plaque explained (in English, Mandarin and Hebrew), this area around Huoshan Park was the site of the Jewish ghetto. Bordered on the north by Zhoujiazui Road, on the south by Huimin Road, on the east by Tongbei Road and on the west by Gongping Road, the ghetto was roughly 1 sq mile in size. More than 15,000 Jews lived inside those boundaries in the early 1940s, and Huoshan Park served as a sort of public living room where many Jews gathered during the day. Unlike some of the Jewish ghettos in Europe at that time, Tilanqiao did not become fenced off. But it was a deprived and depressed place, according to Dvir Bar-Gal, an Israeli journalist and expert on Shanghai's Jewish history, who has been leading tours of Tilanqiao since 2002.

"Imagine being a doctor, lawyer or musician living in Vienna and suddenly you're unemployed in the [ghetto] of Shanghai," Bar-Gal said. "So, it was not a happy place. But they tried to maintain Jewish life by doing traditions like theatre and music. They were earning very little in doing this but [Tilanqiao] was thriving with Jewish life in the 1930s."

You may also be interested in:
Hong Kong's guardian of the gods
The Indian synagogues preserved by Muslims
The 96-year-old painter who saved a village

According to Bar-Gal, even prior to the Japanese invasion, many Jewish refugees in Tilanqiao lived in poverty compared to their comfortable lifestyles back in Europe. Conditions worsened greatly after Japanese soldiers gathered Jews from across Shanghai and forced them to all live within the borders of this newly formed ghetto. Jews were banned from leaving the area, even for work, unless they received permission from Japanese officers, which rarely happened.

Disease and malnutrition plagued the many heinously overcrowded group homes. "It went from a poor neighbourhood to an extremely poor neighbourhood," Bar-Gal said. "Many people had no jobs and lived in communal housing with many other beds and common bathrooms and kitchens. They had zero privacy and almost no food."

Yet, while six million Jews were murdered during the Holocaust, and up to 14 million Chinese soldiers and civilians were killed during their nation's war with Japan from 1937 to 1945, the majority of Shanghai's Jewish refugees survived. This remarkable feat was described by Holocaust historian David Kranzler as the "Miracle of Shanghai", and according to Bar-Gal, they survived because Jews weren't a primary target of the Japanese forces.

The majority of Shanghai's Jewish refugees remarkaly survived the war

In 1945, when World War Two ended with the defeat of Japan and Nazi Germany, Japanese troops retreated and most of Shanghai's Jews quickly left, relocating to places like the US, Australia and Canada. But had Shanghai not taken these refugees in, many of these more-than-20,000 Jews may have never survived the Nazi death squads.

These days, Tilanqiao is a decidedly Chinese neighbourhood with hardly any foreign residents. Fewer than 2,000 Jews currently live in Shanghai, down from about 4,000 prior to the coronavirus pandemic, Bar-Gal said. None of them, as far as he knows, are relatives of the Jews that once lived in this ghetto. But many descendants of those who sought refuge here and may have otherwise not been born have visited Tilanqiao.

Before the pandemic, Bar-Gal used to show Jewish visitors where their ancestors lived among Tilanqiao's many low-rise, dilapidated buildings. He misses this experience, having suspended his tours and leaving Shanghai last year due to the coronavirus outbreak. In his absence, however, the story of this unlikely Jewish ghetto has not faded, thanks to the Shanghai Jewish Refugees Museum, housed on the grounds of the Ohel Moshe Synagogue. This Jewish place of worship acted as a community hub of Tilanqiao during World War Two. Then in 2007 it was converted into a museum, which re-opened last December after a major extension and is dedicated to preserving the little-known story of how Shanghai acted as "a modern-day Noah's Ark" for Jews, as it says on its website.

If the [people of Shanghai] had not been so tolerant, our life would have been miserable

The synagogue's prayer hall serves as the museum's entry point, and has not been altered since it was in regular use. Exhibits show how Tilanqiao's Jewish community formed, as well as intimate personal tales of Jewish refugees, according to Sophia Tian, the director of the museum's Exhibition and Research Department. I was particularly struck by the story of Dr Jacob Rosenfeld. This Jewish refugee came to Shanghai from Austria in 1939 and later joined the Chinese army in its war against the invading Japanese, working as a field doctor and saving the lives of many wounded Chinese soldiers. After being awarded several Chinese military medals, Rosenfeld moved back to Austria in 1949 to reunite with his family. Another exhibit featured the emotional recollections of Jerry Moses, who was just six years old when he and his family fled to Shanghai from Germany in 1941.

"If the [people of Shanghai] had not been so tolerant, our life would have been miserable," Moses is quoted as saying. "In Europe, if a Jew escaped, he or she had to go into hiding, and here in Shanghai we could dance and pray and do business."

The museum also encourages independent walking tours of the Jewish ghetto by providing detailed booklets that explain and map out the historical Jewish sites of Tilanqiao, which are signposted in English. Wandering its streets allowed me to imagine how Tilanqiao must have looked 80 years ago as Japanese troops swarmed Shanghai.

The first structure I came across was the imposing old Tilanqiao Prison. During World War Two, the Japanese incarcerated dozens of Jewish refugees and Chinese dissidents behind its thick stone walls. The brutality of the Japanese gave the Jews and the Chinese a common enemy and a shared experience. This connection remains strong, according to Tian.

"The Jewish community established a certain relationship, co-operation and affection with the local residents of Shanghai," she said. "They brought European culture to Shanghai and lived in harmony and culturally integrated with the local residents."

Next, on Changyang Road, I passed one of the former Jewish refugee shelters. Now operating mostly as apartments, these seven multi-storey buildings housed more than 3,000 Jewish people in the early 1940s. Nearby, the area along Huoshan and Zhoushan roads was once known as Little Vienna, and was the most prosperous part of Tilanqiao's Jewish neighbourhood. In the late 1930s, those streets were the backbone of Shanghai's Jewish community, and brimmed with Jewish businesses and regular social events at the Mascot Roof Garden atop the former Broadway Theatre. That graceful art deco building, which now operates as a small hotel, was a source of joy for the city's Jews prior to World War Two.

Such camaraderie was key to maintaining the spirit of Shanghai's Jewish community, many of whom still had family in mortal danger back in Europe. At a time when hopeful entrepreneurs from across the world looking to strike it rich had turned Shanghai from a humble fishing village into the world's fifth-largest city, Tilanqiao didn't offer Jewish refugees wealth or luxury, but something much more valuable: safety.

Yet now, eight decades later, the world is hearing the rousing accounts of survival that took place here. And if you look for a lone Star of David, search for a small stone plaque and step into a sacred synagogue that still stands, you can learn the inspiring tale of how China harboured terrified Jews who had no rights and no hope back home.

Join more than three million BBC Travel fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "The Essential List". A handpicked selection of stories from BBC Future, Culture, Worklife and Travel, delivered to your inbox every Friday.