In a wide-ranging professional life, Albert O. Hirschman worked at prestigious colleges and institutes, wrote some of the most perceptive works of social science in his era and acquired a devoted following of economists, political scientists and journalists.

Through his books, lectures and essays, Dr. Hirschman, who died Dec. 10 at age 97, sought to apply rigorous and rational social-science scholarship to clashes of political ideology and economic impasses — conflicts that have often fueled violence and repression. Having learned the stakes firsthand, he devoted his career to advancing economic development and the spread of democracy.

Raised in Germany in the aftermath of World War I, Dr. Hirschman witnessed the rise and spread of fascism in Europe in the 1930s and was credited with helping save hundreds of lives through his work with the anti-fascist underground before and during World War II.

His admirers found him remarkable in part because he maintained a fundamentally optimistic view of human nature despite the tumult he had witnessed. He rejected the notion that societal problems are intractable. His life, his biographer Jeremy Adelman once wrote, “can be seen as a parable of the horrors and hopes of the 20th century.”

Otto Albert Hirschmann — his name later would be changed — was born April 7, 1915, in Berlin to an assimilated family of Jewish origin. He was baptized a Protestant.

His father, a surgeon, died of cancer in 1933, the year that brought Adolf Hitler to power as German chancellor. Dr. Hirschman left Germany to pursue studies in France and later at the London School of Economics. At the start of the Spanish Civil War in 1936, he put his education on hold to join the anti-fascist forces that ultimately lost to Gen. Francisco Franco.

“I could not just sit and look on without doing anything,” he once told an interviewer.

He eventually returned to his studies and received a doctorate in economics from the University of Trieste in Italy in 1938 — the year Benito Mussolini’s regime enacted anti-Semitic laws.

Dr. Hirschman served in the French army at the start of World War II and went underground after the French surrender to the Germans in 1940. He made his way to Marseille, where he became second-in-command to Varian Fry, an American journalist who orchestrated the escape from Europe of 2,000 Jews and other refugees, including the artists Marc Chagall and Max Ernst.

Dr. Hirschman’s nickname was “Beamish,” Fry recalled in an account of their exploits, “because of his impish eyes and perennial pout, which would turn into a broad grin in an instant.”

Fry credited Dr. Hirschman with being a crucial member of the rescue network. “Beamish” rustled up fake identification documents for refugees and, having studied in detail the vagaries of black markets, devised new ways to smuggle money into France.

When fascist authorities learned of Dr. Hirschman’s activities, he, too, had to flee. He crossed into Spain over the Pyrenees on foot, Adelman said in an interview, bringing with him extra socks and a two-volume collection of the works of Montaigne.

Dr. Hirschman arrived in the United States in 1941 and worked briefly at the University of California at Berkeley before joining the Office of Strategic Services, the precursor of the CIA.

In 1945, he served as an interpreter in one of the early war crimes trials of German military officials. “Grave-faced,” wrote a Time magazine reporter, Dr. Hirschman informed a German general that he would be “shot to death by musketry.”

After the war, Dr. Hirschman worked for the U.S. government on the Marshall Plan to rebuild Europe. His first book, “National Power and the Structure of Foreign Trade” (1945), grew from his experience during the war and was an early indication of his inclination to combine political science and economics.

He spent several years as an economist with the Federal Reserve Board, which sent him to Colombia for field work. The experience led to a lifelong interest and expertise in Latin American politics and economics. Over the decades, he sharply criticized the U.S. government’s foreign aid packages that tried to attach Cold War strings to much-needed economic development support in Latin America, Adelman said.

In a 1984 New Republic article titled “Self-Inflicted Wounds,” Dr. Hirschman said that “a precious capital of good will that we have slowly accumulated in Latin America” among the poor and middle-class professionals was endangered by right-wing ideologues of the Reagan administration.

Specifically, the article targeted the White House’s purging and underfunding of “people-to-people,” self-help development grants from the government-supported Inter-American Foundation. The Reagan administration “does not need to look for outside enemies,” Dr. Hirschman concluded, “it displays an uncanny knack for self-inflicted wounds.”

His books included “The Passions and the Interests: Political Arguments for Capitalism Before Its Triumph” (1977), “Shifting Involvements: Private Interest and Public Action” (1982) and “The Rhetoric of Reaction: Perversity, Futility, Jeopardy” (1991).

Perhaps his most noted volume was “Exit, Voice, and Loyalty: Responses to Decline in Firms, Organizations, and States” (1970). In essence, the book examined why some people remain loyal to an unsatisfactory institution and voice their opposition from within while other people opt to walk away.

For example, in troubled countries, why do some citizens choose to stay and others decide to emigrate? In the context of economics, why do some consumers complain to companies about poor service while others simply take their business elsewhere?

Dr. Hirschman parsed the explanations for such decisions and the very nature of loyalty. In the midst of the Vietnam War and civil unrest in the United States, “the exit, voice and loyalty vocabulary immediately shaped scholarly discourse,” writes Adelman, a Princeton University history professor.

Dr. Hirschman’s death, in Ewing Township, N.J., of undisclosed causes, was confirmed by a spokeswoman at the Institute for Advanced Study in Princeton, N.J. He had been on the institute’s faculty from 1974 until retiring in 1985. Earlier, he had worked at Yale, Columbia and Harvard universities.

His wife of 70 years, the former Sarah Chapro, died in January. A daughter, Lisa Hirschman Gourevitch, died in 1999. Survivors include a daughter, Katia Salomon of Paris; a sister; four grandchildren; and nine great-grandchildren.

Dr. Hirschman rarely spoke about his painful wartime past. His optimism, Adelman said, “required selective forgetting.”

Dr. Hirschman did once remark that his work with Fry was “a sort of exciting high point” in his life.

“It was,” he said, “a great adventure.’’