When Sonia Gandhi came to this dusty corner of India nearly 20 years ago, thousands turned out to see the beautiful, Italian-born widow of a slain former prime minister and beg her to enter politics. “Sonia, save India!” they chanted.

Since then, Gandhi has become the most powerful woman in India and president of its oldest political party. But on a rainy spring afternoon, when she returned to her family’s political stronghold in the state of Uttar Pradesh to campaign for reelection to parliament, her crowd was small and muted.

As voting in national elections enters its final phase, Gandhi’s Congress party lags behind in most polls. Now reputedly in poor health, Gandhi has said she would like to step down in a few years. But her dimple-cheeked son, Rahul, 43, has shown little aptitude to take over.

The party's sliding popularity threatens to sideline a political dynasty that has dominated Indian politics since independence, when Rahul’s great-grandfather, Jawaharlal Nehru, became prime minister. The Gandhis won deep loyalty over the years for their message of lifting up India’s impoverished masses. But the country’s growing urban and middle classes are now angry about government corruption and want politicians who focus on jobs rather than social-welfare benefits.

Gandhi, 67, was nearly three hours late for her recent campaign stop in Amethi, her son’s electoral district. When she finally took the podium, she painted the election as a stark choice between her secular party and the main opposition party, led by Narendra Modi, a Hindu nationalist.

The opposition seeks “to divide the country in the name of religion, caste and creed,” said Gandhi, wearing a perfectly draped sari and speaking in heavily accented Hindi. “Our party’s objectives bind the country together for progress.”

She spoke for only 15 minutes, but the crowd began drifting away before she even finished.

In contrast, two weeks later, when Modi came to town, tens of thousands of supporters turned out for a speech in which he taunted the Gandhi family.

“No one can save this mother-son government now,” Modi said. The crowd roared.

Outsize influence

Since she took over as the head of the 128-year-old Indian National Congress party in 1998, Sonia Gandhi has wielded outsize influence in the country of 1.2 billion. Forbes magazine ranks her No. 9 on its list of the world’s most powerful women, behind Hillary Rodham Clinton but ahead of Oprah Winfrey. Yet in many ways Gandhi remains an enigma. She shuns the spotlight, relies on the advice of a few close advisers and her two children, and hardly ever gives interviews.

“Her strength is her silence,” said Rasheed Kidwai, the author of “Sonia: A Biography.” The fact that her appearances are so few and carefully crafted “makes her something regal" in the noisy Indian political landscape, he said.

Gandhi led her party and its regional allies to victory in 2004 and 2009. She turned down the chance to become prime minister in 2004, feeling her foreign birth would be an obstacle in a country still scarred by centuries of foreign rule. Instead, she chose a soft-spoken economist, Manmohan Singh, to take the country’s helm.

Nonetheless, Gandhi has been the driving force behind many of the country’s costly social programs enacted in recent years — such as guaranteed rural employment and the distribution of grains to the hungry. Her power is discreet but vast — a recent book by a former top aide to the prime minister suggested she had hand-selected the country’s finance minister without consulting Singh, a charge her party denies.

“The ‘buck didn’t stop’ with the head of the government,” said Sanjaya Baru, the former aide, who was Singh’s media adviser. “It went all the way up to the head of the party.”

Sonia Gandhi was an unlikely heir to the Gandhi political legacy. She grew up in modest circumstances in a small town in Italy, the daughter of a mason. In the 1960s, not long out of high school, she traveled to Britain to study English and met a Cambridge University student named Rajiv Gandhi — the grandson of Nehru and the son of India’s powerful prime minister, Indira Gandhi.

The couple married in 1968 and moved into the prime minister’s residence. Sonia at first found the adjustment difficult, Kidwai wrote. Her mother-in-law insisted they speak only Hindi at the dinner table. But Sonia eventually renounced her Italian citizenship.

“I came here because I was madly in love with my husband and he was with me,” Gandhi said in a rare television interview in 2004. “It didn’t matter what I had to face.”

Rahul was born in 1970, daughter Priyanka in 1972.

Although Gandhi initially set out to be the perfect “bahu” — Hindi for daughter-in-law — a series of tragedies altered her life. In 1984, her mother-in-law was shot by her Sikh bodyguards. Sonia cradled the dying Indira Gandhi as she was rushed to the hospital. Sonia begged her husband not to accept the post of prime minister, fearing for his life, but he did and served one term. He was assassinated while attempting a political comeback in 1991.

Congress party leaders urged Sonia Gandhi to take up her husband’s mantle.

“She was reluctant, but once she joined and plunged into politics there was no holding her back,” said Zoya Hasan, an academic and the author of a book on the Congress party.

Gandhi projected a motherly image and united her fractious party, which has traditionally appealed to a wide range of India’s caste and religious groups.

But in recent years, Gandhi, who was known for her robust energy on the campaign trail, has cut back. In 2011, she underwent surgery in the United States for a still-undisclosed ailment. She appeared tired and pale at the recent speech in Amethi, later canceling three rallies scheduled for the next day.

Sanjay Jha, a Congress party spokesman, said Gandhi might have been sick that day but is “perfectly fine.”

The transition to her son has been rocky. The younger Gandhi was named party vice president last year — to celebrations in the streets and exploding fireworks. But he has danced around the question of whether he wants the top job, earning the nickname “the Reluctant Prince.” Critics say he lacks the charisma and ease with voters that his mother and grandmother had. Nor is he as popular as his sister Priyanka, who is not a candidate but has campaigned vigorously for her family.

Rahul Gandhi has worked to try to promote younger politicians and inject new life into the party, his supporters say. But many — particularly in the country’s growing urban middle class — see him as a candidate of the elite.

“India has changed, and the influence of the Nehru-Gandhi family is waning,” Hasan said.

In a country that has become outraged by corruption scandals, it does not help that the Gandhi family’s own wealth appears to have grown.

The Wall Street Journal reported last month that Sonia Gandhi’s son-in-law, who has a high school education and previously ran a costume jewelry business, amassed a real estate portfolio worth $42 million from 2007 to 2012. Priyanka Gandhi said her husband had been “defamed.”

As Modi’s opposition Bharatiya Janata Party surges, promising cleaner government and greater economic growth, its leadership has crowed that the days of the Gandhi dynasty are numbered.

Still, it may be premature to count out the Gandhis, no matter how their party fares when votes are counted May 16. The country remains fascinated with the family and follows the Gandhis’ every move, as if they were movie stars. And hereditary politics have deep roots in a society shaped by patronage and family tradition. Nearly a third of the members of the Lok Sabha, the lower house of Parliament, have family connections to politics, according to an analysis by the author Patrick French.

“The Gandhi family’s commitment to India and their leadership to India is strong,” said Jha, the party’s spokesman. “That’s one of the reasons why the opposition targets them personally.”

‘Her wishes prevail’

Sonia Gandhi’s parliamentary district, Rae Bareli, is not far from her son’s, in an area of northern India where the family has had a presence since the 1950s. Sonia Gandhi has helped bring additional paved roads, a petroleum institute and a rail coach manufacturer to the area. However, residents in both constituencies lack indoor plumbing, as well as a reliable water and electricity supply.

Still, many remain loyal to Gandhi, whom they call “Madam.”

“After her marriage, she has become pure Indian,” said R.P. Pandey, 66, a retired telecommunications executive. “The party is being run by her. It’s a democratic party, but her wishes prevail, because they are universally correct.”

Gandhi made a rare appearance recently to file her paperwork to run for reelection. Her supporters stood in the sun in Rae Bareli for over an hour, cheering and beating drums, before she arrived at the district office in an SUV driven by her son. The crowd pelted her with rose blossoms. Gandhi paused before the cameras.

“The people of Rae Bareli have accepted me with lots of love, and I hope they will elect me again,” she said quietly. Then her son put his arm around her protectively, and almost as quickly as she had arrived, she was gone.

Rama Lakshmi in New Delhi, Jalees Andrabi in Rae Bareli and Sushil Kumar Tiwari in Amethi contributed to this report.