On Friday, as opposition leader Narendra Modi swept to victory and fireworks exploded throughout the capital, the mood at the governing Congress party headquarters was grim.

Late in the afternoon, the mother and son who lead India’s oldest political dynasty finally emerged to speak to supporters and journalists.

“There’s a lot for us to think about,” said a chastened Rahul Gandhi, the party’s heir apparent and chief campaigner. “As vice president of the party, I hold myself responsible for what has happened.”

But then, as he stepped aside to let his mother speak, he smiled — some observers thought with relief. The Twitterverse took note.

Gandhi, whose lineage includes three prime ministers, had been groomed for India’s top job for a decade. But his evident ambivalence about the prospect was among the drivers of the Indian National Congress party’s worst drubbing in its history, analysts said. The party won just 44 seats in the 543-seat lower house of Parliament, while Modi’s Bharatiya Janata Party took 282 in a landslide.

Hindu nationalist Narendra Modi and his Bharatiya Janata party decisively win India's election and are set to lead the world's largest democracy. (Reuters)

Even before the Gandhis departed without taking questions, the postmortem had begun: The Congress party was out of touch with voters, analysts said. Its leaders were corrupt and inefficient. And unlike the canny chief minister preparing for his triumphant arrival in the capital, they had missed India’s moment. Even Congress’s own members, still dazed by the scale of the defeat, could see that.

“India has changed,” said Sachin Pilot, 36, one of the Congress party’s younger leaders, who was defeated Friday in the state of Rajasthan. “The party has failed to connect with the new India of aspirations. We haven’t been able to tap into the imagination of the new India, the youth and the middle classes, the upwardly mobile people. . . . Somewhere our message was not clear, was not appropriate for the new era.”

The Congress party has governed the country for most of the years since India won its fight for independence from Britain in 1947. Many of its policies today have roots in the vision shaped by the country’s first prime minister, Jawaharlal Nehru — Rahul Gandhi’s great-grandfather — of uplifting the masses.

Yet, despite that history of political success and its recent 10-year rule, the party seemed woefully unprepared as it headed into the 2014 general election.

Rahul and his mother, Sonia, the Congress party president, campaigned in their usual way, appearing at large rallies where they emphasized signature subsidy programs such as distribution of wheat and grains to the poor, and talked about rural employment.

Modi, meanwhile, was spreading his message of economic opportunity via a sophisticated 24-hour campaign operation with millions of volunteers, including many from the Hindu nationalist movement, and teams of technology gurus to manage his wide-ranging social media efforts.

Modi’s campaign “was not about this dole or that dole; it was not about how much free rice or free wheat his party will give. It was about all the things that were wrong with the country — unemployment, corruption, inflation,” said Manisha Priyam, the India coordinator for research on elections at the London School of Economics. “No previous election in India has been able to remove welfare populism completely from its language. Modi has achieved that.”

Some voters said that the Gandhi family seemed elitist and out of touch with the people’s problems.

“The Congress party used to listen to us, but they no longer do,” said Usha Sharma, 64, a retiree from New Delhi. She said that the Congress party of years gone by would help with jobs but that she lacks running water even now. “There’s no point in voting for them.”

Rahul Gandhi, in particular, seemed unable to connect with voters, spending much of his time with his nose in his smartphone or going over spreadsheets with his cadre of advisers, many of whom had been educated overseas, party critics said. Many of his efforts to reach younger voters — such as a pilot primary system to make campaigns more egalitarian — failed. It was the 63-year-old Modi, who blogs and tweets, whom India’s more than 100 million first-time voters embraced.

The stunning defeat has led to a call for the first family’s ouster and to questions about whether the country’s long love affair with dynastic politics is finally over.

Conservative pundit Surjit S. Bhalla, in a piece titled “The Gandhis Should Resign” in Saturday’s Indian Express newspaper, wrote that the party and the dynasty are finished.

“When will the leaders realize that feudalism is over, that monarchy is over?” Bhalla wrote.

Yet, many of the party’s leaders fear that without the first family and its charisma, the party will fall apart. It splintered briefly in the 1990s before Sonia Gandhi, the widow of the slain former prime minister Rajiv Gandhi, finally agreed to step in as president.

Pilot counters that the reality is “not so simplistic.”

“Some hard decisions have to be taken” when party leaders gather Monday to assess the damage, Pilot said. “We have to fix our shop on many fronts. Mrs. Sonia Gandhi led us to two successive victories and nobody at that time said the family was irrelevant. We all share the credit, and we have to share the blame, too.”

Jalees Andrabi contributed to this report.