Not long after Yosef Hayim Yerushalmi — perhaps the most esteemed Jewish historian of the last half century — died two years ago, at 77, his wife Ophra got a frequent question: “Is there anything else he’s written that hasn’t been published?”

What they meant, presumably, was other academic work, certainly not fiction. But it was fiction — particularly, a short story called “Gilgul,” which The New Yorker published last week — that was the only other thing Ophra knew of. “Nobody knew about it, just me and my son,” she told The Jewish Week in a phone interview. “Not even our friends knew he wrote fiction.”

Ophra remembered Yerushalmi working intensely on something for a few weeks in 2004, but not telling her what it was. Only when he finished, did he say, “Let me read it to you,” Ophra recalled. “He got very emotional about it.”

Yerushalmi never tried to publish it. But after all the questions following his death, Ophra decided to show it to a friend of theirs in Paris. The friend told her it was good enough to publish. A month ago, Ophra pitched it to The New Yorker.

“I didn’t know if they’d take it,” she said, “but it was my first choice.”

That the magazine published the only piece of fiction Yerushalmi ever wrote is all the more surprising. “I was impressed that it came from someone who has never written fiction before,” said Deborah Treisman, the fiction editor at The New Yorker. “It has a lovely lyrical line to it.”

The story follows a character not unlike Yerushalmi. Simply called Ravitch, he’s a scholar of Jewish history living in New York, who, on a whim, flees to Israel.

“Everyone knew Yosef was deeply attached to Israel,” Ophra said, though she cautioned against reading the story too autobiographically. “I would be very wary of making too many parallels. You have to leave something to the imagination.”

While in Jaffa, Ravitch visits a mysterious psychic who tells him a long story — several pages long, quoted in full — about a restless Jewish man with the soul of a medieval Spanish Jew named Isaac Benveniste.

Expelled in 1492, Benveniste wandered for years throughout the Mediterranean, but never stepped foot in Israel. He died just short of it, in Rhodes.

The only way the man with Benveniste’s soul could be at rest, the psychic tells Ravitch, would be if the man went to Benveniste’s grave in Rhodes and said Kaddish over it, “as though you were the mourner.”

“After that,” the psychic tells Ravitch she told the man, “you must prostrate yourself to the ground. You needn’t mention God. But you must pray, in your own words, that Benveniste’s soul should cease its wanderings, that this should be its final gilgul” — the wandering of souls, in Hebrew — “and that you, too, should at last find peace.”

Yerushalmi’s first book was about a medieval Spanish Jew named Isaac Cardoso. Cardoso abandoned his life as a successful court physician — but one who had to hide his identity — in order to live openly as a Jew in Venice.

“Zakhor,” Yerushalmi’s most famous book, published in 1982, was about the tension between Jewish memory and Jewish history — and more broadly, the ancient, spiritual and religious life versus the modern, secular and academic one.

“Many Jews today are in search of a past,” Yerushalmi wrote, “but they do not want the past that is offered by the historian.”

Yerushalmi, who taught at Harvard and Columbia, was never quite sure he wanted the history he had to offer either. He was observant in his youth, and later ordained at the Jewish Theological Seminary, but then abandoned a life at the pulpit for one at the professor’s podium.

The dilemma he faced was similar to Ravitch’s: Should he embrace the emotional pull of faith? Or should he dismiss it and risk finding only cool comfort in the facts?

“I think his life conflict was unresolved,” Ophra said of the Ravitch character.

And how about her husband, Yosef? Was his conflict unresolved too?

Perhaps, she ventured: “Like everyone, we all carry unresolved conflicts within us. It is for Ravitch, as much as for Yerushalmi, up to the reader to interpret.”