Speaking at the government-run Siri Fort Auditorium in New Delhi, the president said India must learn to treat both women and religious minorities equally. India is nearly 80 percent Hindu but also has significant Muslim, Sikh, Buddhist and Christian populations.

Mr. Obama said his own life offers an example of how some view one religion more favorably than others and seek to divide people along lines of faith.

“There were moments in my life where I’ve been treated differently because of the color of my skin,” he said. “There have been times where my faith has at times been questioned by people who don’t know me, or they’ve said that I adhere to a different religion, as if that were somehow a bad thing.”