“Attack on one faith is an attack on all faiths,” he declared. “We cannot be bystanders to bigotry.”
Mr Obama told the congregation that the mosque, like many in this country, was “an all American story”.
To those Americans who have never visited a mosque, he said: “Think of your own churches and synagogues, where people come to worship, to express their love for God and to each other.”
Mr Obama said that he was not the first US president to be called a Muslim, Thomas Jefferson’s opponents also called him a Muslim. “So, I am in good company.” It was in these mosques, he said, where an overwhelming majority of Muslims worked to build “bridges of understanding with other faiths, Christians, Jews” and ran health centres and taught their children.
He said he was now going to say two words that Muslim “do not hear often enough, thank you. Thank you for serving your community and for helping us keep united as one American family”.
Mr Obama acknowledged that this was a time of “concern and frankly of some fear” for Muslim Americans.
“Your entire community so often is targeted and blamed for the violent acts of the very few,” he said.
“Overwhelming majority of world’s Muslims, and I repeat an overwhelming majority, who embrace Islam as a faith of peace,” he said. There is a tiny minority, which purposely uses selected religious verses to spread a message of hate but this was not the first time this had been done and Islam is not the first religion exploited this way.
“Most Americans don’t know a Muslim person and only hear about Muslims and Islam from the news after an act of terrorism and from distorted media personnel on TV and films,” he said.
Mr Obama noted that during the current presidential campaign politicians were using “inexcusable political rhetoric against Muslims” that has no place in the American society.
He also noted that the mosque he visited was twice attacked, while Muslim children were bullied, and mosques were vandalised across America. Even those perceived to be Muslims were attacked, he added. Mr Obama said that Islam had always been a part of America and many of the slaves brought here were Muslim and kept their faith alive.
Before addressing the congregation, Mr Obama had a closed-door meeting with Muslim community leaders.