Sonia Gandhi walks to address her party workers at the All India Congress Committee meeting in New Delhi on January 17, 2014. Adnan Abidi / Reuters

In 1994, Sonia Gandhi published a book of photographs from her private life with her late husband, Rajiv Gandhi. It included a dozen pictures from their trips to Italy, where she had grown up in the suburbs of Turin. Here she was in a speedboat in 1980, wearing crimson-framed sunglasses and a matched paisley shawl. Here was their son Rahul, just seven or eight years old, on a beach pushing goggles off his face into his hair.

What made the book, titled Rajiv’s World, so unusual then was the photographer: Rajiv Gandhi, the former prime minister of India killed in a suicide bombing. What makes the book unusual today is how much it shares of the interior life of Sonia herself—before she transcended her origins to become India’s most powerful politician.

This week, Sonia Gandhi retired as president of the Indian National Congress, a position she had held since 1998, longer than anyone before her. She is succeeded by her son, Rahul Gandhi, the sixth of his line to lead the party. If he one day becomes prime minister, Rahul will be the fourth Nehru-Gandhi to do so—India has had one from every generation since its independence.

Rahul Gandhi’s patrimony reaches him thanks only to his mother’s intervention. When she was 22, Sonia left her home in Piedmont, Italy, to marry into India’s most exalted political family. But a series of violent deaths in the 1980s left her its sole adult survivor, casting her in the role of tragic widow and reluctant champion of India’s secular heritage. She led the Congress party out of its doldrums to victory in two successive national elections, in 2004 and 2009. To many, her supremacy in Indian politics was bitter proof of a national weakness for dynastic rule. But she also re-committed the Congress to its founding, pluralist values, resisting the trend of religious populism that has gained ground in recent decades.

In power, Sonia was an enigma. The early nineties, when she compiled Rajiv’s World and its biographical companion, Rajiv, were the last years in which she could publish old photos and frank reminiscences. In Rajiv’s World, she described arriving in Cambridge and falling in love with a cherubic Indian student at a Greek café in 1965. She had not heard of his late grandfather, Jawaharlal Nehru, India’s first prime minister and nation-builder-extraordinaire. She had only “a vague idea that India existed,” she wrote, “with its snakes, elephants and jungles.” But she flew there in 1968, and she and Rajiv were married.

In New Delhi, Indira Gandhi, Nehru’s daughter and Sonia’s new mother-in-law,  had outmaneuvered a conservative old guard to secure her succession as party president. The Congress was redefined as a firmly socialist party, built around the charisma of the first family. To all this, Sonia and Rajiv were but spectators. Rajiv was “happy in jeans,” he said, and content with his life as a pilot for the state-owned Indian Airlines. For Sonia, those were “the spacious years”: With their children, Rahul and Priyanka, the couple made trips back to Italy; Rajiv climbed Mount Etna to photograph its steaming crater.

Two assassinations forced Sonia out of her private life. In 1984, Indira Gandhi was shot dead by her own bodyguard—revenge for ordering the army into the Golden Temple at Amritsar, which was being used as a stronghold by Sikh militants. Rajiv, by then a member of parliament, was sworn in as prime minister the same evening, as bloodthirsty anti-Sikh mobs raged across Delhi.

In the turbulent years that followed, separatist movements flared up along India’s borders, and ethnic rivalries deepened in the heartland—at times with Rajiv’s aid, as when he allowed Hindus to worship at a medieval mosque, which extremists claimed was built over the birthplace of the divine king Ram. In 1991, Rajiv was campaigning in a town near Madras when he was killed by a suicide bomber—revenge for his intervention in Sri Lanka, which had pitted Indian troops against the rebel Tamil Tigers.

Rajiv’s death could have meant the end of Sonia’s life in India. She was alone, devastated by grief, and in fear for her children’s safety. But the absence of Gandhis from the Congress in the 1990s coincided with the loss of its power to a scrum of smaller parties. Election followed election, producing only fractured mandates and the advance of its nemesis, the Bharatiya Janata Party (BJP), the advocates of Hindutva or the doctrine of Hindu hegemony in the subcontinent.

In their time, both Indira and Rajiv Gandhi had woven religious appeals into Congress politics; both also lost their lives to communal furies. By 1996, the Congress party itself was in peril. It seemed only a family member could save it. Sonia formally stepped in and joined the Congress party in 1997. Less than a year later, buoyed by family loyalists, she was enthroned as its president. From the start of her life in India, she had been marked as a foreigner, disparaged as “the Italian au pair.” As first lady, she had endured the opposition’s chants of Videshi biwi, videshi paisa (“Foreign Wife, Foreign Funds”), which painted her as an agent of foreign interests.

Yet she worked hard to assimilate, and Indian society met her half-way. In India, a bride traditionally becomes part of her husband’s community; as a daughter-in-law, Sonia was accepted as fully a Gandhi, and as an adopted Indian. But to succeed as Congress president required an even deeper act of ethnic passing. She now only wore saris, in subdued tones. She addressed rallies in Hindi, though with an imperfect accent. There would be no more unguarded interviews, memoirs, or photos from the beach. For Mrs. Gandhi to emerge, Sonia had to be sealed away.

In the elections of 2004, after the BJP’s first full term in power, the Congress returned as the largest party in parliament. The result shocked even Sonia’s closest circle, but she had only begun to exercise her political talent. Could she be prime minister? The mere notion had conservatives in a lather, but Sonia disarmed them by declining to head the government herself, instead appointing Manmohan Singh, a former finance minister and a Sikh. It was an inspired calculation as well as a moving spectacle—of renunciation for Sonia and atonement for her family’s violent history with the Sikhs.

With her opponents deflated, she recruited allies: Communists, peasant socialists from the Hindi-speaking heartland, and vernacular champions from the South, an ensemble united only by a desire to contain the BJP. Earlier coalitions built on that foundation had collapsed, but Sonia had forged an unlikely rapport with the power-brokers from the provinces. “She had none of the baggage every Indian ruling class politician has—caste, region,” Sitaram Yechury, secretary general of the Communist Party of India (Marxist), told me. “She was bereft of those labels. That helped to keep such a disparate group together.” The result was the United Progressive Alliance (UPA), and a new decade of Congress rule in India.

At the outset, the UPA pushed its progressive agenda, including a Right to Information law and a massive rural-employment scheme, seeking to restore a balance between neoliberal reforms and welfare commitments. In its second term, however, the UPA began to implode. Sonia was frequently ill, and Singh was unable to check the graft and theft perpetrated by allies and party functionaries. The malfeasance recalled older scandals in which Rajiv and Sonia had themselves been implicated in the 1980s. Soon, Sonia’s pale, drawn face became one on which the opposition could project all kinds of sinister intentions.

This was an exceptionally poor moment for Sonia to declare Rahul the Congress party candidate for prime minister in the next election. The choice sealed the image of India’s grand old party as one controlled by a single family and its privileged courtiers, all part of a corrupt liberal establishment in denial about the populist resentment surging against it. In Rajiv, Sonia wrote that she “fought like a tiger” to save her husband from his political inheritance. Now she had mortgaged the future of her party, and of India’s progressive center, to deliver that inheritance to her son.

The credible promise of the Congress party—that it could govern with both expertise and empathy—was lost by a candidate who could not prove the former, and a government that had lost sight of the latter. Indians, meanwhile, were bearing out Alexis de Tocqueville’s proposition that it is not impoverishment but rising expectations that set the stage for revolution. As the fruits of Singh’s economic reforms dried out, his party seemed the obstacle to greater prosperity. The Congress reached the end of its term in a crouch, unable to counter the BJP’s cult of national renewal and Hindu unity.

In 2014, the Congress was routed—Indian voters gave the BJP, and its candidate Narendra Modi, a mandate no party has had in 20 years. This was not just a transfer of power but a movement of archetypes across the political horizon: The immigrant widow who rose from her family’s ashes, displaced by an avenging son-of-the-soil, who left his wife to devote himself to his creed.

The temptation to fight Hindu nationalism on its own terms, using “soft Hindutva” to appeal to the majority, remains great. On the eve of his succession, Rahul Gandhi’s focus was the state election in Gujarat, Modi’s home province. The thrust of his campaign was to visit as many Hindu shrines as possible—which headlines sardonically called the “Temple Run,” after the iPhone game. Sonia never gave in to that temptation. More than any of her family since Nehru, she defended an inclusive idea of India, even as it lost political purchase—a pact she kept with a country that had included and accepted her. On Saturday, as she formally passed the torch to her son, she spoke in Hindi, saying, “We are not the kind to be afraid or to bow down. Our struggle is a struggle for the soul of this country. We will never back down."

As Modi goes about normalizing Hindu nationalism, it is easy to forget that recent past in which India was so pleased with its pluralism. In 2004, we could congratulate ourselves on having a Muslim president, a largely Hindu executive led by a Sikh, and a ruling party led by a woman born Roman-Catholic. As India’s primetime television swells with denunciations of outsiders and “anti-nationals,” it is worth remembering that India could elect and re-elect a party led by a woman foreign by birth, upbringing, and language, and Indian only because of love. We may yet come to miss her.