Bernard Bailyn, an influential Harvard historian whose books about the American Revolution reshaped how scholars viewed the motives of the Founding Fathers and immigration to the New World, died Aug. 7 at his home in Belmont, Mass. He was 97.

A son, John F. Bailyn, said the cause was congestive heart failure.

For the first half of the early 20th century, historian Charles A. Beard provided the defining perspective on the revolutionary generation of Americans. By declaring independence, he wrote in his 1913 book “An Economic Interpretation of the Constitution of the United States,” the founders were mainly motivated by economic self-interest, such as their opposition to British taxation.

Dr. Bailyn offered a strong riposte to that argument with his breakthrough volume, “The Ideological Origins of the American Revolution” (1967), which received the prestigious Bancroft Prize for American history writing and the first of his two Pulitzer Prizes for history.

Burrowing himself in 18th-century source materials, Dr. Bailyn used pre-revolutionary political pamphlets to portray the colonists as deeply principled and driven by radical ideas about republicanism and liberty in the face of encroaching British power.

Efforts to justify and understand their break with Britain led “to this whole expansion of their ideological commitments as they grope to explain what it is they’re trying to preserve and what it is they’re trying to oppose,” Dr. Bailyn said in a 2003 C-SPAN television interview. “By the time you get to 1776, there’s an elaborate structure of thought that’s worked out that justifies this and that really sets American constitutional thought on its path.”

By providing a new framework for interpreting the American Revolution, Dr. Bailyn’s findings influenced a generation of historians.

“ ‘Ideological Origins’ turned the field around,” said Gordon S. Wood, a Pulitzer-winning historian at Brown University who in the 1960s switched his focus to the colonial period after attending one of Dr. Bailyn’s seminars at Harvard. “He launched a major transformation in the way we look at the revolution.”

In his writings, Dr. Bailyn was a strong proponent of American exceptionalism, which celebrates New World innovations and deviations from European traditions and restrictive social hierarchies.

He argued that the Founding Fathers were not the imposing icons portrayed on Mount Rushmore but were, in a sense, the founding rustics. Living in isolated colonies far removed from the received political wisdom of Europe, these provincials were free to experiment with fresh ideas, such as the then-radical notion of sovereignty divided between national and state governments.

“They gave us the foundations of our public life,” Dr. Bailyn said in 2010 upon receiving the National Humanities Medal. “Their world was very different from ours, but, more than any other country, we live with their world and with what they achieved.”

Dr. Bailyn was also fascinated with history’s losers. In “The Ordeal of Thomas Hutchinson,” he profiled the next-to-last loyalist governor of Massachusetts, a well-meaning public servant who badly miscalculated the colonists’ fervor and became the revolution’s Hamlet.

It was a nuanced, sympathetic portrait that won the National Book Award for history. But it was published in 1974 just as the Nixon administration was collapsing, and within this polarized political atmosphere, some critics interpreted it as an ode to blind loyalty and, indirectly, as a defense of the disgraced president.

Dr. Bailyn and his supporters called that interpretation wildly off base, as he had almost no interest in contemporary politics.

In fact, Daniel Ellsberg, the military analyst and Nixon nemesis, was a fan of Dr. Bailyn’s writings and cited him in justifying his 1971 decision to leak the Pentagon Papers, a secret history of the government’s involvement in the Vietnam War. Ellsberg carried a worn copy of “Ideological Origins” in his briefcase and liked to quote one of its passages about defying the traditional order in the quest for freedom. He told a reporter that the words brought tears to his eyes.

Fascinated by migration patterns of the colonial period, Dr. Bailyn moved on to become a leading figure in the field of Atlantic history — the idea that the continents bordering the Atlantic Ocean were, at the time, integrated and similar in character and best studied as an interactive whole.

His next major work, “Voyagers to the West” (1986), was a meticulous demographic study and social history of British immigration to America just before the revolution. The book earned him his second Pulitzer Prize.

In the classroom, Dr. Bailyn was often an electrifying presence, but he could also be intimidating and was forever challenging his students to think clearly and explain themselves. Rather than examining what the past was like, he posited that the true historian focuses on why one part of the past had supplanted another.

“Bailyn’s seminar was at once mystifying and elating,” Stanford University history professor Jack N. Rakove wrote in a 1998 essay in Humanities magazine. “For the first half of the course, we were never quite sure what the subject was. Each week’s readings were so eclectic that we went to class wondering what we would possibly discuss. . . . Bailyn left us to puzzle things out for ourselves, goaded only by his critical eye and his alarming propensity to call us short with the most famous of all his questions: ‘So what?’ ”

Indeed, Dr. Bailyn’s towering status was, in part, the result of his tutoring of Harvard doctoral candidates who themselves went on to become esteemed historians — including Rakove, Wood, Richard D. Brown, Richard L. Bushman, Pauline Maier and Mary Beth Norton — and who would often promote and expand on their mentor’s findings.

Dr. Bailyn’s theories also engendered a bitter backlash. Detractors claimed he idealized the founders and dismissed interpretations that clashed with his own conclusions. Others accused him of giving short shrift to class and racial conflicts, thereby reducing the revolution to a debate among well-educated pamphleteers.

Writing in the New Republic in 2003, historian Alan Taylor (then of the University of California at Davis, now at the University of Virginia) argued that Dr. Bailyn framed the revolutionary era as far too homogeneous and upbeat, while playing down the role of Native Americans and the massive influx into the colonies of enslaved people from Africa.

As a result, Taylor added, Dr. Bailyn “tells only the edifying part of the tale, for the colonial environment created as much misery as opportunity, and more individual dependence than independence.”

In all, Dr. Bailyn wrote, co-authored or edited nearly two dozen books on subjects ranging from the enduring relevance of the Federalist Papers — the anonymously published articles from 1787 and 1788 that served as guides to how the new U.S. government would work — to the bloody clashes between the colonists and Native Americans in one of his last books, “The Barbarous Years” (2012).

His volumes were never as popular as books by David McCullough and other best-selling history writers, but Wood said they had far more impact within the profession.

“It is no exaggeration to say that his influence on what the nation knows about its own beginnings is immense, if incalculable,” Washington Post critic Jonathan Yardley wrote in 2003.

Bernard Bailyn was born on Sept. 10, 1922, in Hartford, Conn., where his father was a dentist.

Dr. Bailyn said he always wanted to be a teacher and a historian, once telling an interviewer, “How history is put together and the way we reconstruct from small pieces of evidence of one kind or another and illuminate dark parts that hadn’t been seen before — that craft of history interested me.”

He initially focused on medieval and German history at Williams College in Massachusetts, to which he returned after a two-year stint in the Army Signal Corps during World War II. He received a bachelor’s degree in 1945. But he eventually became fascinated by the revolutionary era, in part because its constitutional debates and tensions over race relations never lost their relevance.

At Harvard, he earned a master’s degree in 1947 and a doctorate in 1953, both in history. Viewed as a rising star, he was almost immediately offered tenure on the Harvard faculty, where he stayed for the rest of his career.

In 1952, he married Lotte Lazarsfeld, an Austrian-born scholar who became a professor of management at the Massachusetts Institute of Technology. Besides his wife, survivors include two sons, Charles D. Bailyn, a professor of astronomy at Yale University, and John F. Bailyn, a professor of linguistics at Stony Brook University in New York; and two granddaughters.

Dr. Bailyn disdained comparing the past to the present but on occasion would muse about what the Founding Fathers — such as George Washington, Benjamin Franklin and Thomas Jefferson — would make of today’s federal government. Despite gridlock, soaring deficits and out-of-control campaign spending, Dr. Bailyn said, “I think on the whole they would be pleased with the way the national government has worked.”