Rabbi Avraham Shmuel Goldberg, left, and Rabbi Mosheh Twersky were among victims of an attack on a Jerusalem synagogue by two Palestinians on Nov. 18, 2014. (Israel's Ministry of Foreign Affairs/Via AP)

Rabbi Mosheh Twersky, scion of two of Orthodox Judaism’s most storied families and a well-known teacher himself, lived a life of Torah and prayers. He died while worshiping Tuesday in a Jerusalem synagogue, wrapped in a prayer shawl and with a black box holding scripture affixed to his forehead, part of the morning ritual of the Orthodox Jew.

The Boston-born Twersky was one of four rabbis — three Americans and one Briton — killed during early-morning worship at a synagogue in a hilly West Jerusalem neighborhood popular with English-speaking Orthodox Jews. The brutality of the attack at such a familiar place, combined with Twersky’s death, brought the Middle East violence directly to the small, tightly knit American Orthodox community in the United States and Israel.

Orthodox leaders across the United States called for people to gather Tuesday night at their synagogues and to recite specific psalms that speak to God of desperation, mercy and wickedness. “Peace be on Israel,” ends Psalm 125, one of five psalms they were urged to pray.

Killed by Palestinian assailants were Twersky, 59; Aryeh Kupinsky, 43, who grew up near Detroit; Cary William Levine, 55, from Kansas City, Mo.; and Avraham Shmuel Goldberg, 68, of Liverpool, England. An Israeli policeman also was killed in the attack.

Twersky’s family — on both his mother’s and father’s sides — have been the royalty of American Orthodoxy for a century.

His maternal grandfather, Rabbi Joseph Soloveitchik, is perhaps modern Judaism’s most towering philosopher, and his father, Rabbi Isadore Twersky, established Harvard’s Center for Jewish Studies. His paternal grandfather, Rabbi Meshullam Twersky, was a grand rabbi of the Orthodox school called Hasidism.

He came “from a family of princes,” said Rabbi Marc Penner, dean of Yeshiva University in New York, the flagship school of Modern Orthodoxy in the United States.

Twersky’s brother, Mayer, is one of the “heads” of the university, where a prayer meeting was held Tuesday.

“We talk about six degrees of separation, but the Jewish people are more like a family. It’s more like one or two degrees of separation,” Penner said. “I think that when one of the victims hits so close to home, it reminds us that whenever there’s a tragedy on either side, it’s an entire world that’s snuffed out.”

Judaism calls for the dead to be buried as quickly as possible, and the narrow streets of Har Nof were a sea of black streaming to funerals for the victims.

“Wrapped in a prayer shawl and phylacteries, the four victims were massacred, and numerous more suffered injuries,” Rabbi Yitzchak Mordechai Rubin, chief rabbi of the Bnei Torah synagogue in Har Nof, said at the joint funeral, according to the Times of Israel. “We have passed from a private state of mourning to a public one.”

Phylacteries is another way of describing tefillin, which are spiritual devices, made of leather and a small black box, containing prayers. They are worn on a man’s forehead, connecting hands, head and heart.

Two Palestinian men allegedly killed four people with axes and knives inside a synagogue in Jerusalem early Tuesday, before police shot them dead. The attack happened in an ultra-Orthodox neighborhood of West Jerusalem. (Reuters)

As evening prayers were called across the country, Levine’s family gathered in his hometown, Kansas City.

“My father would study [Torah] all day long and would return home at night only to learn some more until he would fall asleep in his chair,” Levine’s son, Rabbi Yerachmiel Levine, said in a statement.

In Michigan, friends of Kupinsky remembered the boy they grew up with near Detroit.

The fourth victim was identified as Goldberg in several reports. A spokesman for the British Foreign Office would not confirm Goldberg’s identity but said: “We are aware of the death of a dual British-Israeli national in Israel on the 18th of November 2014.”

Goldberg had worked in publishing and lived in north London before moving to Israel, according to the Jewish News, a British newspaper. He reportedly immigrated to Israel in the 1990s.

“He was the most wonderful person you could meet, a pillar of the community,” one of Goldberg’s friends, David Osborne, told the paper. Osborne described his friend as “a devout Jew with no political agenda.”

“All he wanted was to live a peaceful life,” Osborne said. “His family are the nicest people you could meet. They had lots of children and several grandchildren.”

Twersky was the first grandson of Soloveitchik and “the apple of his eye,” said Rabbi Menachem Genack, chief executive of OU Kosher, a global arm of the Orthodox Union that certifies foods as kosher.

Twersky attended Harvard University and soon moved to Israel, where he was a teacher at Yeshivas Toras Moshe – a school founded by a cousin and named for the same ancestor for whom Mosheh Twersky was named.

“He was so extraordinary. He was quiet, very brilliant, very insightful, he just saw things the way they really were,” Genack said.

Because Twersky grew up around such giants — and especially because he had access to study with his grandfather — people were curious. Genack said he remembers saying to the teenage Twersky: “I wish I had the notes” from his talks with his grandfather.

While Soloveitchik was known as a powerful, sometimes intimidating teacher with students, “with Mosheh, he was just different.”

Twersky is survived by a brother, sister, mother, wife and five children, according to a statement from the Maimonides School, the prominent day school founded by his grandfather in Brookline, Mass.

“The Maimonides School Family is engulfed in grief and outrage today,” the school said in a statement.

Twersky’s sister, Tzipporah Twersky Rosenblatt, is married to Jonathan Rosenblatt, chief rabbi of the well-known Riverdale Jewish Center in the Bronx.

Judaism refers to children who lose their fathers as orphans, and on Tuesday, Israeli media reported people were calling the street of the killings “24 Orphan Street” — for the 24 children left fatherless.

Ruth Eglash in Jerusalem contributed to this report.