President Barack Obama has lauded Muslim Americans as patriots and heroes, and decried discrimination and violence against Muslims in the U.S.

“This is a difficult time for Muslim Americans,” Obama said at a White House dinner celebrating the Islamic holiday of Eid al-Fitr, which marks the end of Ramadan, Islam's holiest month, in which observers fast from sunrise to sunset.

The president said Muslim Americans "are as patriotic, as integrated, as American as any other members of the American family," and he extolled the contributions of Muslim doctors, entrepreneurs, artists, activists, athletes, police officers, firefighters and soldiers.

In a pointed jab at the anti-Muslim rhetoric by Republican presidential nominee Donald Trump, Obama said, "Singling out Muslim Americans feeds the lie of terrorists like ISIL that the West is somehow at war with a religion that includes over a billion adherents. That’s not smart national security."

Trump has called for a ban on Muslims from entering the country, as well as putting mosques under surveillance.

This is a difficult time for Muslim Americans." Obama said, "Like all Americans, you worry about the threat of terrorism. But on top of that, you fear that your entire community will be blamed for the violent acts of a few who do not represent your faith."  The statement prompted chants of "Four more years," from the 100 guests. “No, no,” he said. “Michelle’s going to come down and scold you.”

There were about 3.3 million Muslim Americans living in the United States in 2015, according to Pew Research Center estimates, making up about 1 percent of the total U.S. population.