From a spartan basement synagogue in Crown Heights, Brooklyn, Rabbi Menachem Mendel Schneerson became the spiritual leader to tens of thousands of Hasidic Jews across the globe, a man whose counsel was sought by world leaders and rock ’n’ roll icons.

As the grand rabbi, or Rebbe, of the Chabad-Lubavitch movement, Schneerson was a pioneer — the man who, unlike other Hasidic rabbis, made it his mission to spread Judaism across the globe, dispatching an army of emissaries to convince Jews to become more observant.”

He was also — some of his followers still believe — the messiah.

But he had no children, so when Schneerson died 20 years ago on June 12 at the age of 92, the group’s seventh grand rabbi also turned out to be the last — there was no consensus who the next leader should be.

The leadership vacuum hasn’t mattered much. Schneerson’s spectre remains as powerful now as when he was alive; the sect has become the largest Jewish religious organization in the world.

At its core, his philosophy was simple. Instead of citing the old Yiddish expression repeated for generations during times of stress that “it’s hard to be a Jew,” Schneerson turned the mindset around — and it caught on:

“It is good to be a Jew.”

The son of a rabbi, Schneerson was born in 1902 in the southern Ukranian city of Nikolayev. By the age of 13, he was being home-schooled by his father, Talmudic scholar and Kabbalist Rabbi Levi Yitchak Schneersohn, who allowed his son — who hung a map of the universe in his bedroom — to indulge in a fascination for astronomy.

Schneerson, who in the years that followed would be uprooted by anti-Semitism that spread like cancer across Europe — first by Communists and later by the Nazis — was passionate about the issue of Jewish suffering and eventually salvation, Joseph Telushkin writes in his new biography “Rebbe.”

“From the day that I was a child attending [Jewish elementary school],” Schneerson once wrote, “and even before, the vision of the future redemption began to take form in my imagination — the redemption of the Jewish people from their final exile, a redemption of such magnitude and grandeur through which the purpose of suffering, the harsh decrees and annihilations of exile will be understood with a full heart and cognizance.”

In 1928, he began study at the University of Berlin, taking courses in philosophy, analytical geometry and theoretical physics, under the likes of Nobel Prize winners such as Walther Nernst and Erwin Schrödinger.

That same year, he married Chaya Mushka — the daughter of the sixth Lubavitcher grand rabbi, Yosef Yitzchak Schneerson, a distant cousin he had met five years earlier.

“I have given my daughter to a man who is totally fluent in the Babylonian and Jerusalem Talmuds and knowledgeable in the entire writings of the [classic and modern commentators of the Talmud], and much, much more. At four o’clock in the morning, he has either not yet gone to sleep, or has already awoken,” his father-in-law gushed.

Excelling in the sacred texts, Schneerson was no slouch in his secular studies either. In 1937, he graduated with a mechanical and electrical engineering degree from the prestigious École Spéciale des Travaux Publics in Paris, where he also took classes at the Sorbonne.

Three days before Paris fell to the Nazis, Schneerson and his wife fled for Vichy, then Nice, and eventually, in 1941, Brooklyn, settling on New York Avenue, just a few blocks from the new headquarters his father-in-law founded after his escape, at 770 Eastern Parkway.

Hasidim, “pious ones” in Hebrew, is a branch of Orthodox Judaism founded in Eastern Europe in the 1700s by the mystical rabbi Yisroel ben Eliezer, also called Baal Shem Tov, who stressed rapture in worship and prayer, often pairing it with song and dance. It’s been called a revival movement — opposed to the staid orthodoxy of the time.

It gave rise to charismatic leaders — rabbis whose followers believed possessed supernatural abilities. Schneerson, it was believed, was able to commune with his dead father-in-law at a cemetery in Queens; and some followers treat his writings and videos as tarot cards.

It was not a unified movement. There are an array of sects, including the Chabad-Lubavitch, founded in Russia in 1775; the Satmars, founded in 1905 in Satu Mare, Transylvania, by Rabbi Joel Teitelbaum; and the Bobovs, founded in Bobowa, Galicia in southern Poland around 1892.

As the Nazis tore through Europe, they decimated the Hasidic dynasties, who made a desperate bid for Israel or America, where they founded their headquarters in Brooklyn modeled after the original communities — the Lubavitchers in Crown Heights, Satmars in Williamsburg and the Bobovs in Borough Park.

The sects —whose number is about 250,000 combined in New York City — have different philosophies. For example, the Satmars believe that Jews should not have a homeland in Israel until the arrival of the Messiah; the Lubavitchers are pro-Israel.

The Lubavitchers have another fundamental difference, because of Schneerson — while other sects insulate themselves from the outside world, they engage secular society to teach non-Orthodox Jews to become more observant, sending emissaries across the globe to do God’s work and making teaching accessible to a wider audience.

Schneerson was unique because of his extensive secular education — and also his awareness of popular culture — which he used to help spread the word.

To broaden the appeal of one of the group’s children’s magazines, Schneerson looked to the funny pages. “Ess zol oys’zehn vee Dick Tracy” he said — make it look more like the popular crime fighter’s comic strip.

“The mindset of Menachem Mendel Schneerson was peculiarly congenial to the United States,” Telushkin writes.

In the Lubavitch movement, there is no delineated pattern of succession, save for being a descendent of the founder of the sect, Rabbi Shneur Zalman.

Schneerson’s father-in-law had no sons of his own but considered his daughter’s husband a “gaon,” the Hebrew word for genius.

Schneerson never coveted the position of grand rabbi — but he understood that the movement’s future depended on him becoming leader, notes Telushkin, whose father was Schneerson’s accountant.

There was no vote; Schneerson accepted the appointment on Jan. 17, 1951, a year after the first anniversary of his father-in-law’s death.

“One must go to a place where nothing is known of Godliness, nothing is known of Judaism, nothing is even known of the Hebrew alphabet, and while there, put one’s own self aside and ensure that the other calls out to God!” he said. “Everything now depends on us.”

Over the next several decades, Schneerson reigned over an unprecedented expansion of the Lubavitch movement.

He started a revolution, sending emissaries, or “shluchim,” to travel around the globe to stem the tide of assimilation, armed with the belief that all Jews — and all of humanity — had a spark of divinity.

When you’re asked on a street corner, “Are you Jewish?” or invited to say a prayer in a tricked out RV called a “Mitzvah Tank” — it’s all Schneerson’s doing.

The movement also took out full-page ads to remind followers when to light Sabbath candles; set up a network of summer camps; and expanded across college campuses.

Schneerson even insisted that girls as well as boys be featured on the cover of the sect’s youth magazine — though women are still forbidden from reading the Torah in synagogue, and kept separate from men during services.

He made sure his followers stayed put in Crown Heights — in 1969 he decreed they remain, as white flight gripped much of the borough.

In 1986, he started a Sunday tradition where he’d meet any and all visitor, handing out dollar bills intended to be given to the charity of their choosing.

“When two people meet, something good should result for a third,” he once said, quoting his father-in-law.

They had the cash to do it — The Times reported that a Schneerson aide said the group, which does not publicly reveal its financial statements, raked in over $100 million in contributions in 1992. Today the cumulative budget has swelled to $1 billion.

And Schneerson did it all while rarely leaving Brooklyn. Instead, the big shots — Presidents Jimmy Carter and Ronald Reagan, Israeli Prime Ministers Menachem Begin to Ariel Sharon — sought out his advice, as did the like of Bob Dylan, who visited Schneerson in Crown Heights more than a half-dozen times.

Schneerson died in 1994 at Beth Israel Medical Center a few months after suffering a paralyzing stroke.

Some 35,000 mourners filled the streets of Crown Heights. Many more did not, however, because to them, the rabbi had simply gone into hiding and would one day emerge as the messiah — a living person, according to Jewish belief, whose presence will be followed by the resurrection of the dead.

After his death, the matter seemed decided.

“We do not believe, with all due respect, in dead messiahs,” Rabbi Abraham Hecht told Newsday at the time.

Yet others still hold out hope.

“I believe that almost everyone in the movement believes that he can be the messiah — the fact that he passed away physically is not an issue,” said Rabbi Shmuel Klein, adding that Schneerson possessed special powers. “He gave many blessings and most, if not all, came true.”

Schneerson never publicly denied that he was the messiah, but he didn’t believe it to be the case, Telushkin argues.

Just before his first stroke in 1992, Schneerson received a letter from another rabbi in which he was referred to as “King Messiah.”

“The Rebbe had looked at the letter, thrown it down in frustration and then wrote on it, ‘Tell him that when the Moshiach [messiah] comes, I will give him the letter.’”

The Lubavitch remain without a grand rabbi, and there is no indication they will have one anytime soon — because adherents say Schneerson’s teachings continue to inspire and guide.

His leadership from beyond the grave seems to be working fine — in the 20 years after his death, the organization has doubled in size, the largest Jewish religious group in the world.

“It is Chabad’s point of view that the American mind is simple, honest, direct — good, tillable soil for Hassidism, or just plain Judaism,” Schneerson once said.

And he was right. The movement, which boasts about 1 million adherents worldwide, has now spread to 48 states — South Dakota and Mississippi are without Chabad houses — which are now in about 80 countries, including far flung outposts such as Congo and Cambodia.

“He launched the first effort I know of in Jewish history to reach every Jewish community and every Jew in the world,” Telushkin said. “As the former British Chief Rabbi Jonathan Sacks commented, ‘If Hitler wanted to hunt down every Jew in hate, the Rebbe wanted to track down every Jew in love.’”