(JTA) — A decade ago, the tiny Jewish Community of Porto didn’t have enough money to hire a rabbi or even fix the roof of its synagogue.

Today, this Orthodox congregation of 400 people in northern Portugal has enough for both, along with a kosher hotel, a ritual bath, a cantor, security guards and a new museum.

As of this month, it’s also in show business.

“Sefarad,” a 90-minute melodrama produced by the community that tells its history, began streaming on iTunes earlier in November. The film will launch on Amazon Prime next month. According to a former community official, the film cost $1.1 million. A Los Angeles-based publicist hired to promote it said a “private benefactor” paid.

The Porto community is tight lipped about how it came to have that kind of money. Requests for comment from the Jewish Telegraphic Agency were declined.

Yochanan Moran, a community spokesman, insisted in 2016 that private donors and tourism revenues paid for the other amenities.

But the spending spree roughly coincided with a 2015 law that granted citizenship to the descendants of Sephardic Jews expelled from the Iberian Peninsula during the Inquisition. The law, which preceded similar legislation in Spain, tasked the cast-strapped community in Porto and its counterpart in Lisbon with vetting thousands of citizenship applications, for which they charged handsomely.

To many in the Jewish world, the law was a heartwarming gesture at a time of rising anti-Semitism. But to the Portuguese communities, it also meant a huge new source of revenue, as each application came with hundreds of dollars in fees.

It also caused some internal strife.

The community’s previous president, Jose Ferrao Filipe, said he was removed from his position because of a fight over communal resources. Its current leadership said he was trying to convert Jews to Christianity.

Filipe, a soft-spoken psychologist who in 2005 slept in the synagogue with 16 other Jews for days as they awaited Orthodox conversion by an Israeli rabbinic tribunal, has denied the allegations.

Whatever its funding source, “Sefarad” is probably the costliest film ever produced by a Jewish community in Europe, and perhaps beyond.

Featuring dozens of extras in medieval costumes, elaborate cinematography and a backdrop set in a real Portuguese castle, the film is worthy of any Hollywood period drama. It opens with a dramatic Inquisition scene, then cuts forward several hundred years to tell the story of the Porto community’s 20th-century champion, Artur Carlos de Barros Basto, a captain in the Portuguese Army.

As violin music soars in the background, the film dramatizes Barros Basto’s rescue of Jews fleeing persecution in Eastern Europe and his outreach to reclusive communities in rural Portugal who had concealed their Jewish customs for centuries after the Inquisition. It follows the captain’s story through to his downfall due to anti-Semitism and false charges of sexual misconduct, all of it chronicled in terms that are understandable, if not always subtle. Lovers of Latin soap operas will not be disappointed.

In one scene, a gravel-voiced villain proclaims: “Now we’ll see, Captain Barros Basto, how you’ll get yourself out of this!” In another, a Jewish leader watching the new arrivals from the east turns to his colleagues and breathlessly declares: “Our responsibility is great. We are their last hope. Without us, they will surely die!”

Barros Basto has long been held up as a hero by Porto Jews. After reconnecting with his Jewish identity, sacrificed during his career in the pro-fascist dictatorship of Antonio de Oliveira Salazar, Barros Basto devoted his life to helping other Jews make a similar journey. He died, disgraced by the charges against him, in 1961.

The film is a logical continuation of the Porto community’s efforts to rehabilitate the captain’s reputation. In 2012, the community and Barros Basto’s granddaughter, Isabel Ferreira Lopes, successfully lobbied parliament to officially clear the captain’s name. In 2015, the community opened a new museum devoted entirely to Barros Basto.

“It was not hard to destroy the Jewish Community of Porto and reduce it to raw insignificance,” the community said in a statement upon the opening of the museum. “One had only to belittle and humiliate Arthur Carlos Barros Basto, the real engine of the entire organization.”

But, they added, “he never lost hope in the idea of cleaning his tarnished name and being reinstated with full rights in the military, stating on the day before his death: ‘One day, they will do me justice.’”

As a historical document, “Sefarad” has a few weaknesses. In one scene, actors are shown praying in what Ben Gurion University historian Eliezer Papo describes as “the Ashkenazi rocking motion” — not something the Sephardic Jews of Portugal were likely to do. Barros Basto, who is said to have used charisma and kindness to bring whole communities back to Judaism, is portrayed as being so zealous “that it’s as if he’s a little Mussolini,” Papo said.

But the film does get some historical details right, including its depiction of Sephardic Jews praying with outstretched palms.

“Compared to the nonsense you see in Hollywood,” Papo said, “this film is all right.”