Benedict Anderson, a scholar of Southeast Asia who transformed the study of nationalism by positing that nations were “imagined communities” that arose from the fateful interplay of capitalism and the printing press, died on Saturday night at a hotel in Batu, Indonesia. He was 79.

The death was confirmed by his friend Tariq Ali, who had worked with him at the journal New Left Review and at the publishing house Verso Books. The cause appeared to be heart failure, Mr. Ali said.

Dr. Anderson’s best-known book, “Imagined Communities: Reflections on the Origin and Spread of Nationalism,” first published in 1983, began with three paradoxes: Nationalism is a modern phenomenon, even though many people think of their nations as ancient and eternal; it is universal (everyone has a nation), even though each nation is supposedly utterly distinctive; and it is powerful (so much so that people will die for their countries), even though on close inspection it is hard to define.

Dr. Anderson believed that liberal and Marxist theorists had neglected to appreciate the power of nationalism. “Unlike most other isms, nationalism has never produced its own grand thinkers: no Hobbeses, Tocquevilles, Marxes or Webers,” he wrote.