Fritz Stern, who fled Nazi Germany as a boy and became a leading historian of the land he left behind, illuminating the forces that shaped the German state from its founding through the Holocaust to modern times, died May 18 at his home in New York City. He was 90.

The cause was cancer, said his wife, Elisabeth Sifton.

Dr. Stern spent half a century as a professor at Columbia University, where he was educated after arriving in New York City on the eve of World War II. He was 12 years old when his family left Germany in 1938 and took with him the memory of a society on the brink of the darkest chapter in its history.

A grandson of Jewish converts to Christianity, Dr. Stern was baptized at birth but was nonetheless a target of Hitler’s anti-Semitic persecution. Before his 20th birthday, 6 million Jews — among them his aunt and uncle — had perished in the Holocaust, an event that would leave generations of German Jews alienated from their homeland.

As a scholar, Dr. Stern sought to answer what he described as a “burning question”: “Why and how did the universal human potential for evil become an actuality in Germany?”

In his search, he rejected what he regarded as simplistic and wrongheaded answers, such as the theory expounded by historian Daniel Jonah Goldhagen in his best-selling book “Hitler’s Willing Executioners” (1996) that ordinary Germans had readily participated in the Holocaust because of an “eliminationist anti-Semitism” rampant in the German culture.

Dr. Stern condemned Goldhagen’s thesis as “the indictment of a people” and said that he resented “all the tomes and slogans about Germany’s inevitable path ‘from Luther to Hitler.’ ”

In his writings, Dr. Stern traced decades of German history. His first book, “The Politics of Cultural Despair: A Study in the Rise of the Germanic Ideology” (1961), analyzed three German intellectuals of the late 1800s and early 1900s — Paul de Lagarde, Julius Langbehn and Arthur Moeller van den Bruck — whose philosophies, he argued, helped open the way for National Socialism.

In the book “Gold and Iron: Bismarck, Bleichröder, and the Building of the German Empire” (1977), Dr. Stern explored the relationship between Otto von Bismarck and Gerson von Bleichröder, the Jewish banker who became one of the Iron Chancellor’s closest advisers.

In his essays, collected in volumes including “The Failure of Illiberalism” (1972) and “Dreams and Delusions: The Drama of German History” (1987), Dr. Stern embarked on broad explorations of German culture, political and otherwise.

He attracted particular notice with a later volume, “Five Germanys I Have Known” (2006), a memoir spanning the Weimar Republic, the Third Reich, the divided worlds of East Germany and West Germany during the Cold War, and the unified nation that emerged after the fall of the Berlin Wall in 1989.

“Decades of study and experience have persuaded me that the German roads to perdition, including National Socialism, were neither accidental nor inevitable,” he wrote. “National Socialism had deep roots, and yet its growth could have been arrested.

“I was born into a world on the cusp of avoidable disaster,” he continued. “And I came to realize that no country is immune to the temptations of pseudo-religious movements of repression such as those to which Germany succumbed. The fragility of freedom is the simplest and deepest lesson of my life and work.”

Dr. Stern’s works were widely read in the United States and in Germany, where he received some of the country’s highest literary honors, and where he became, the New York Times once reported, a “moral arbiter” and “perhaps the closest thing to a trusted external judge of the country’s bitter internal debates.”

“The skill of Fritz Stern’s depictions and his integrity,” Roland Ulmer, the president of the German Publishers and Booksellers Association, told the Times, “have generated an atmosphere that provides the descendants of the victims and the descendants of the perpetrators with the building blocks from which to fashion a shared memory of a time when German-Jewish patriotism was thinkable.”

Fritz Richard Stern was born on Feb. 2, 1926, in the city that was then Breslau, Germany, and that today is Wroclaw, Poland. His father was one in a long line of doctors, and his mother was a teacher.

Before leaving for the United States, the young Dr. Stern observed the demagoguery that whipped his classmates and the country into a nationalistic frenzy. He recalled his math teacher posing questions such as, “If three Jews robbed a bank, and each got a part of the loot proportionate to their ages . . . how much would each get?”

Before beginning his studies at Columbia, Dr. Stern consulted the physicist Albert Einstein, a family acquaintance, who advised him to study medicine instead of history. Dr. Stern went with history, later writing “Einstein’s German World” (1999), a work of biographical history.

He received a bachelor’s degree in 1946, a master’s degree in 1948 and a PhD in 1953, all from Columbia. Among his classmates was the poet Allen Ginsberg. His professors included the literary critic Lionel Trilling and the historian Jacques Barzun.

Dr. Stern served in the early 1980s as provost at Columbia. Outside of academia, he was an adviser to U.S. diplomat Richard C. Holbrooke during Holbrooke’s tenure as ambassador to Germany from 1993 to 1994.

Dr. Stern’s marriage to Margaret Bassett ended in divorce. He later was married for 20 years to Sifton, with whom he wrote “No Ordinary Men: Dietrich Bonhoeffer and Hans von Dohnanyi, Resisters Against Hitler in Church and State” (2013).

Besides Sifton, of New York City, survivors include two children from his first marriage, Fred Stern of New York City and Katherine Brennan of Annapolis, Md.; three stepsons, Sam Sifton of New York City, Toby Sifton of Brunswick, Maine, and John Sifton of Washington; seven grandchildren; and two great-grandchildren.

Reflecting on the passage of time, Dr. Stern once remarked that “memory may be mighty . . . yet it can also be inaccurate. It keeps us on our toes, but it brings us only to the threshold of historical understanding.”

In decades of scholarly pursuits, “no country, no society, is shielded from the evils that the passivity of decent citizens can bring about,” he wrote. “That is a German lesson of the twentieth century — for all of us.”