Updated

Rabbi Shmuel Berenbaum, a Talmudic scholar who led a yeshiva in Brooklyn for more than 50 years after fleeing Nazi-occupied Poland and briefly taking refuge in Shanghai, has died. He was 87.

Berenbaum died Sunday after a long struggle with cancer, said Rabbi Pinchos Hecht, executive director of the 1,200-member Mir Yeshiva. Another branch of the yeshiva is in Jerusalem, with an estimated 4,000 students.

Tens of thousands of mourners turned out for a funeral Monday in Brooklyn, Hecht said, citing police estimates. He said Berenbaum's body would be flown to Israel on Tuesday for burial in Jerusalem.

Mayor Michael Bloomberg issued a statement praising Berenbaum, noting that he built the Jewish academy "into one of the largest centers for Torah study in the world."

Berenbaum was born in Poland and studied in a yeshiva in the town of Mir before World War II. As the Nazis rolled across Eastern Europe, Berenbaum and other yeshiva students fled across the Soviet Union and resettled in Shanghai, China. From there, they eventually emigrated to the United States.

Steven Bayme, national director of contemporary Jewish life at the American Jewish Congress, said the yeshiva helped preserve "a world that was otherwise lost."

"The rescue of the institution during the Holocaust by going to Shanghai was an act of incredible daring. It took enormous courage and perseverance," Bayme said.

Leadership of the Brooklyn yeshiva will pass to Berenbaum's nephew, Rabbi Osher Kalmanowitz.