Carolyn Kaster, Associated Press
President Barack Obama and Indian Prime Minister Narendra Modi have coffee and tea in the gardens of the Hyderabad House in, New Delhi, India, Sunday, Jan. 25, 2015.

NEW DELHI — President Barack Obama gently nudged India Tuesday to fulfill its constitution's pledge to uphold the "dignity of the individual," drawing on his own experience as a minority in the United States as he closed out a three-day visit to New Delhi.

Speaking to an audience of young people, Obama said that while he has had extraordinary opportunities, "there were moments in my life where I've been treated differently because of the color of my skin." As he touted the importance of religious tolerance, he noted the persistent false rumors that he is a Muslim, not a Christian.

"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," Obama said.

India is largely Hindu, with almost 80 percent following the faith. At over 12 percent Muslims are India's largest minority, with Sikhs, Christians and Buddhists making up the rest. While religious groups largely coexist peacefully, the country has seen several flare ups of violence, primarily between Hindus and Muslims.

The U.S. has said some local laws and policies in India restrict religious freedom, with reports of discrimination and organized attacks against religious minorities. Current Prime Minister Narendra Modi was denied was denied a visa to the U.S. in 2005, three years after religious riots killed more than 1,000 Muslims in the Indian state where he was the top elected official. He has denied any wrongdoing and India's top court has absolved him of any role, but India's Muslims and Christians are wary of Modi's right wing Bharatiya Janata Party.

Equality, across gender and religious lines, is enshrined in India's constitution. But India continues to remain a deeply misogynistic society with a gender ratio skewed in favor of boys. Despite a law that bars sex selective abortions, the practice continues, with girls often considered a burden.

Women also face the risk of harassment and sexual violence, a subject that finally became the subject of public protests after a fatal gang rape on a moving bus in the heart of New Delhi. The protests prompted more stringent laws but critics say more progress is needed.

"Every woman should be able to go about her day — to walk the street, or ride the bus — and be safe and be treated with the respect and dignity that she deserves," Obama said to applause.

Since taking office in May, Modi has often talked about women's rights, urging Indians to treat sons and daughters equally. He recently launched an "educate the daughter, save the daughter," program to stem sex selective abortions and encourage parents to keep girls in schools.

Associated Press writer Muneeza Naqvi contributed to this report. Follow Pace at http://twitter.com/jpaceDC