American society isn't immune from intolerance and violence, Obama said, recalling the 2012 attack on Sikh worshipers at a temple in Wisconsin as an example of "the darkest impulses of man."
In his own life, the president said, his Christian faith has been questioned by "people who don't know me," a reference to lingering suspicions among some about his Islamic heritage on his father's side.
"Every person has the right to practice their faith how they choose," he said, "or to practice no faith at all, and to do so free from persecution and fear."
The speech was the first Obama has delivered on his three-day trip to India without Modi at his side. The two leaders have displayed a concerted effort this week to emphasize the shared interests of their countries and the personal amity between the two of them, and Obama had not previously raised his concerns about human rights in a direct and public way.
But his final set of remarks on the way out of the country came as reformists are hoping Modi will mute the divisive agenda of his militant Hindu-nationalist supporters and turn the country's attention more squarely to economic reform.
Hindu militants have recently run campaigns of mass conversion to bribe or force Muslims and Christians to change their religion, including in Modi's home state of Gujarat.
Though Indian courts found no evidence of Modi's involvement in deadly religious rioting there when he was the state's the top elected official, Muslims and Christians are still wary of his right-wing party.
Modi's Bharatiya Janata Party grew out of a right-wing Hindu nationalist movement, the Rashtriya Swayamsevak Sangh, whose leaders believe that India is a fundamentally Hindu nation. The South Asian nation's 1.2 billion people are 78% Hindu, with Muslims making up the largest religious minority at 14%, according to 2011 census figures.
In recent months, the RSS, for which Modi worked as a volunteer before entering politics, has announced mass camps to "reconvert" Muslims and Christians to Hinduism, claiming their forefathers were forced to change their religions. Hindu fundamentalists also have accused Muslims of marrying Hindu girls for the sole purpose of converting them to Islam, a practice dubbed "love jihad."
Modi has refused to distance himself publicly from the hard-line efforts, although his aides say he does not support forced conversions, which are outlawed in India. Modi did apologize in December after a junior minister in his government described non-Hindus as "illegitimate children," although he rejected calls to fire her.
The Obama administration has worked hard to smooth over hard personal feelings after Modi was denied visa entry into the U.S. in 2005 following the religious rioting.
But as they prepared for this week's trip to promote stronger ties with India, top advisors said Obama did not want to make the journey without specifically addressing the issue of human rights.
As he did so on Tuesday, Obama repeatedly emphasized the two country’s shared democratic values and intertwined histories of struggle: When
"When we were born, people who looked like us still couldn't vote in many parts of our country," he said.
But in India and the U.S., he said, the grandson of a cook and the son of a tea seller can rise to the top elected office in the land.
"Our nations are strongest when we see that we are all God's children -- all equal in his eyes, all worthy of his love," he said. "Across our two great countries we have Hindus and Muslims, Christians and Sikhs, Jews and Buddhists and Jains and so many faiths.
"And we remember the wisdom of Gandhi," he said, quoting Mahatma Gandhi as saying, "For me, the different religions are beautiful flowers from the same garden, or they are branches of the same majestic tree."
Afterward, Obama prepared for a trip to Saudi Arabia to pay respects to the family of the late