First came an honor guard of Muslim Boy Scouts proudly carrying a U.S. flag. Then a rousing Pledge of Allegiance from hundreds of Muslim Americans. Then an introduction from a Muslim college student, wearing a hijab over her head, who wants to be a doctor.
The symbolism was unmistakable Wednesday when President Obama visited the first American mosque of his tenure, a politically fraught trip to the sprawling Islamic Society of Baltimore, where he condemned Islamaphobia on the campaign trail and tried to reassure Muslim Americans not to become isolated in their own country.
Though he never mentioned Donald Trump or other Republican presidential candidates, Obama called for an end to invective that confuses millions of patriotic Americans with a "radical, tiny minority" who engage in violence.
"Since 9/11 and more recently, since the attacks in Paris and San Bernardino, you've seen too often people conflating the horrific acts of terrorism with the beliefs of an entire faith," he said. "And of course, recently, we've heard inexcusable political rhetoric against Muslim Americans that has no place in our country.
"We have to reject a politics that seeks to manipulate prejudice or bias, and targets people because of religion," he said. "We can't be bystanders to bigotry."
Threats and harassment of Muslim Americans "have surged," Obama said. "Here at this mosque, twice last year, threats were made against your children…. We've seen children bullied. We've seen mosques vandalized."
Muslim Americans "keep us safe" as police, firefighters, intelligence officers and members of the military who "fight and bleed and die for our freedom," Obama said.
"So the first thing I want to say is two words that Muslim Americans don't hear often enough — and that is, thank you," he said.
The 45-minute address mirrored Obama's outreach to the Islamic world in 2009, when he stood at a pulpit in Cairo and sought to explain America to Muslims skeptical of Western values. His goal then was to rally Islamic allies to help stabilize the Middle East and fight terrorism.
On Wednesday, Obama tried to explain Islam to Americans, quoting Thomas Jefferson, Benjamin Franklin and other Founding Fathers who welcomed the ancient religion to the new nation. The first U.S. mosque was in North Dakota, he noted. The oldest surviving mosque is in Iowa.
"Islam has always been part of America," he said.
Two Muslim members of Congress joined him at the mosque, which serves about 3,000 Muslims in Baltimore's western suburbs and is one of the largest in the mid-Atlantic region. He paid tribute to its school, baseball and football teams, Girl and Boy Scout troops, and its health clinic for low-income patients of all backgrounds.
The event was a personal milestone for the president with the Islamic name, who was elected only after convincing Americans that he was a Christian and not an adherent to the religion of his Kenyan grandfather. Polls show millions of Americans still believe, inaccurately, that he is a Muslim.
In the kind of joke he never told in his early presidency, Obama noted that Jefferson's opponents "tried to stir things by suggesting he was a Muslim — so I was not the first…. I'm in good company."
But he also batted back charges from Republican candidates that he is deliberately downplaying the threat of terrorism by refusing to refer to Islamic State as "Islamic radical extremism."
"The suggestion is somehow that if I would simply say, 'These are all Islamic terrorists,' then we would actually have solved the problem by now, apparently," he said, to laughter.
"We must never give [terrorists] that legitimacy," he said. "They're not defending Islam. They're not defending Muslims. The vast majority of the people they kill are innocent Muslim men, women and children."
His message stems from intense awareness at the White House that Obama's legacy depends in large part on whether a Democrat replaces him.
Obama and his team have urged Democrats to embrace an upbeat, hopeful message, and are taking every opportunity to characterize the Republican presidential candidates as fear-mongers.
They point to Trump's call for a moratorium on allowing Muslims into the country, and the Republican candidates' opposition to admitting refugees from Syria's civil war out of concern that the vetting process cannot distinguish between those deserving asylum and those with ties to extremist groups.
The choice of the west Baltimore mosque was a study in how difficult that exercise that can be. After the White House disclosed the planned visit last weekend, conservative groups quickly cited its supposed links to extremists.
Mosque attendees have included Majid Khan, an Al Qaeda member who pleaded guilty to transporting money that helped pay for a deadly hotel bombing in Indonesia, the Baltimore Sun reported.
Khan, who was arrested in Pakistan in 2003, now is held at the military prison at Guantanamo Bay, a site Obama has vowed to close.
Also, the mosque's former longtime imam, Mohamad Adam El Sheikh, was quoted by the Washington Post in 2004 saying that suicide bombings might be acceptable in some cases. In an email to the Sun this week, El Sheikh insisted he had never condoned suicide attacks. He called them "un-Islamic."
Others believe Obama's visit is long overdue.
"He probably should have done it seven or eight years ago. He's using this opportunity to gather votes for Democrats," said Saba Ahmed, president of the Republican Muslim Coalition based in Washington.
Still, she cheered the decision given what she sees as a frightening turn toward anti-Muslim sentiment.
"Obama coming to a mosque is a perfect counter message" to Islamaphobia, she said. "It's opening a door for a lot of other people to do the same thing."
White House aides dismissed concerns about the mosque and its alleged ties to extremism as mere politics.
No one should be "surprised to see that the president's visit to a mosque is going to be criticized by the president's political opponents," Press Secretary Josh Earnest said. "We're not concerned about that at all."
For news about President Obama and the Obama administration, follow me on Twitter: @cparsons