Of all the heady rumors to swirl around the Iranian Revolution as it happened, without a doubt the most electrifying was that the Ayatollah Khomeini's first act on taking power would be to announce the end of the world. As promises from politicians go, this would have been a doozy. Devout Iranian Shia believe that their tenth-century spiritual leader, Muhammad al-Mahdi, vanished into a cave in Iraq at the age of five. He remains on earth, living but refusing to reveal himself, and his eventual return will herald divine judgment and the end of time. Could Khomeini be that Hidden Imam in disguise, playing his cards close to his robes until the right moment? No one could remember seeing photos of him as a youngster.

Khomeini's death in 1989 finally killed off the rumor. But his followers' willingness to speculate on his quasi-divinity tells us something important about how this revolution differed from other, more secular regime changes. The most memorable books about the Iranian Revolution have tended to illuminate either the revolution's theology and eschatology (Roy Mottahedeh's "The Mantle of the Prophet") or its worldly politics (Nikki Keddie's "The Roots of Revolution"). James Buchan's Days of God, published last year in the United Kingdom and now here, approaches both sides of this tragic tale, starting in the early twentieth century and leading to their inevitable collision, "like Titanic and iceberg," in 1979. It may be the best single general-audience book on the Iranian Revolution.

Buchan's book shows both Shah Mohammad Reza Pahlavi and Khomeini as terrifically flawed individuals, each empowered by external forces in ways that made their clash more violent and its aftermath even worse. The shah's great flaw – an odd one for an autocrat – is his inability to wield power firmly. Khomeini's great flaw – an odd one for a scholar – is his dull mind, inflexible and willfully uncreative, to the point of malice.

Most Westerners remember the shah as a military potentate, resplendent with self-bestowed medals and armed with every piece of conventional weaponry the Pentagon could think to send him. Yet for all of the might at his disposal, his regime was starved for competent politicians and managers, and the shah himself had low tolerance for blood on the streets. In Buchan's telling, he seems more at home at a ski chalet than on the review stand at a military parade. And when his forces faced their first challengers – domestic Islamic revolutionaries – they soon refused to fight and instead begged their enemies to treat them as neutral. Ryszard Kapuściński's "Shah of Shahs" depicts the shah's security service, SAVAK, as torture-happy and fascistic, which it certainly was. But Buchan points out that its victims were few, relative to other autocratic regimes, such as Khomeini's, which achieved "an absolutism of which the Pahlavis could not have dreamed."

About Khomeini himself, Buchan is withering. Born in 1902, Khomeini impressed his teachers early and by the 1950s already occupied a clerical perch in Qom (Iran's Vatican) that officially made him marja, or "source of emulation," for the whole restive set of shah-hating Iranian clergy. The shah had secularized the country, banning headscarves and imprisoning religious dissidents. Tapping religious fervor, Khomeini called for immediate Islamic government. At the same time he drew on nationalist sentiment by accusing the shah of imitating the West and scorning his own Persian heritage. Buchan makes a good case that this latter charge is deserved: the Pahlavis spent a great deal of embarrassing time romancing various minor Eurotrash royals, the better to link the Peacock Throne to the ruling houses of Greece and England.

But even when right, Khomeini approached the world with Olympian disdain – and not only for secular figures like the shah, Buchan says, but also for the very religious traditions of which he was a part. Buchan quotes Khomeini's letter condemning the 1971 bash thrown by the shah at Persepolis to celebrate 2,500 years of Persian kingship. "It is a typical Khomeini piece from that time, uncompromising in its argument, pungent in its argument, credulous of hearsay, mistaken in matters of fact." Khomeini claims that Shiite clergy have always opposed kings, when in fact Shiite clergy had long put themselves at the service of Safavid and Qajar kings, to mutual benefit. Journalist Peter Jennings buttonholes Khomeini on his triumphant flight to Tehran in 1979 and asks him what he feels on returning to his home country as its leader. The Imam responds with one word: "Nothing." This impassive reply reminds one of Orwell's great line about Gandhi, that some who aspire to be holy have never been tempted to be human.

The character who comes across as most human in this story is Hussein-Ali Montazeri, once Khomeini's prize student and anointed successor but ultimately loathed by his former teacher and placed under house arrest. Unlike Khomeini, Montazeri is a man of earthly temptations (mostly for sohan, the saffron-infused pistachio brittle that is a Qom specialty and perhaps the most addictive candy known to man) and evolving views. He helped lead the revolution but later rebuked Khomeini publicly for the latter's summary executions and indifference to justice. Montazeri died in 2009, after what one Qom cleric told me was a long period of shunning by the city's hard-liners. Buchan clearly views him as a minor hero.

This book breezes through the last twenty-five years, since the end of the Iran-Iraq War, in just a few pages. A sequel may be in order. For now, though, "Days of God" is a balanced portrait of an unbalanced time, and one of the most distinguished books about a revolution that has still not reached its conclusion.

Graeme Wood is a staff editor at The Atlantic. His articles and reviews have appeared in many publications including The New Yorker, Good magazine, and The American.