NEW DELHI — Rahul Gandhi, the scion of India’s famous political dynasty, on Saturday took over as president of the main opposition Congress party, which faces a stiff challenge from Prime Minister Narendra Modi’s ruling Hindu nationalists.
Mr. Gandhi, who took the mantle from his mother, Sonia, at a party function, assumes leadership of a party that has been losing power to Mr. Modi’s Bharatiya Janata Party since 2014. Mr. Gandhi’s party has suffered humiliating defeats in recent state elections despite his active campaigning.
In a speech, Sonia Gandhi described her son as the new hope for the Congress party, as workers danced, burst firecrackers and distributed sweets to celebrate the generational shift in leadership.
Mr. Gandhi, 47, will be taking on Mr. Modi when the prime minister seeks a second, five-year term in 2019. Mr. Modi has vowed to create a Congress-free India while working for the rise of Hindu nationalist forces.
“Today, the Congress faces a possibly existential crisis even as Sonia Gandhi makes way for Rahul Gandhi,” said Neerja Chowdhury, a political commentator.
In his speech, Mr. Gandhi described himself as an “idealist” and said the Indian people were disillusioned by the policies pursued by the Modi government.
He said the Congress party, which had ruled India for decades, took the country into the 21st century through modernization and development. He accused Mr. Modi of taking India “to a medieval path where people are butchered because of who they are, beaten for what they believe in and killed for what they eat.”
“The Congress will take on this challenge and will never back down,” he said.
Mr. Gandhi was referring to killings and attacks on minority groups, especially Muslims, since the Bharatiya Janata Party swept national elections in 2014. Most of the violence against Muslims has involved fringe Hindu vigilante groups that have become active in small towns and cities across India. Muslims make up about 14 percent of India’s 1.3 billion people and Hindus about 80 percent.
Mr. Gandhi is the sixth member of the Nehru-Gandhi family to lead the Congress party. His father, Rajiv Gandhi, grandmother Indira Gandhi, and great-grandfather Jawaharlal Nehru have all served as prime minister since India’s independence from British colonialists in 1947. Rahul Gandhi entered politics in 2004.
Mr. Gandhi was elevated to party vice president in January 2013, serving as his mother’s No. 2. Mrs. Gandhi, 71, was the party’s longest-serving chief, leading it for 19 years. She has been unwell in recent years and has been pushing her son to the fore.
Asked what role she would play after her son’s elevation, Mrs. Gandhi told New Delhi Television on Friday, “My role is to retire.”
Randeep Surejewala, a party spokesman, said later that Mrs. Gandhi had retired as party president but not from politics. “Her blessings, wisdom and innate commitment to Congress ideology shall always be our guiding light,” he wrote on Twitter.
The Gandhi family and the Congress party have released little information about Mrs. Gandhi’s health problems. She had surgery in the United States for an undisclosed reason in 2011, and has returned to the United States for regular checkups since then.