Amid what Muslim American leaders describe as the tensest moment in their community’s history, President Obama visited the Islamic Society of Baltimore on Wednesday and delivered some of the most in-depth comments any American leader has made on Islam in the United States.

Obama’s comments were aimed at a triple audience. He placed greatest emphasis on making an impassioned case to the entire American population to accept Muslims, speaking in terms that were reminiscent of President George W. Bush’s famous post-9/11 “Islam is peace” remarks. Second, he spoke to American Muslims themselves, telling them they have a place in the country but also insisting they must help resist extremism. Finally, he spoke to Muslims around the world, calling for religious freedom and pluralism and saying the U.S. is not at war with Islam.

“Most Americans don’t necessarily know, or at least don’t know that they know, a Muslim personally. And as a result, many only hear about Muslims and Islam from the news after an act of terrorism, or in distorted media portrayals in TV or film, all of which gives this hugely distorted impression,” Obama said. “And since 9/11 but 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. And of course, recently we’ve heard inexcusable political rhetoric about Muslim Americans that has no place in our country.”

In rebuke to politicians like Donald Trump, Obama presented Islam as an essential part of the nation’s heritage, going back to Muslim slaves brought to the British colonies and running through Thomas Jefferson’s Virginia Statute for Religious Freedom up to Fazlur Rahman Khan, who designed two of Chicago’s tallest skyscrapers. And he spoke emotionally about mail he received from Muslim American children and parents who felt persecuted and unsafe.

“We’re one American family. And when any part of our family starts to feel separate or second-class or targeted, it tears at the very fabric of our nation,” he said.

Obama’s visit comes at a time of particular tension for the American Muslim community. Advocates report an increasing number of Islamophobic incidents, which are mirrored in the Republican presidential race. Donald Trump endorsed the suggestion of a registry of Muslims in the U.S., and he suggested barring Muslims from entering the country—even citizens returning from abroad. Other candidates have suggested a link between refugees fleeing Syria and Iraq and terrorism. Although there was a spate of attacks and incidents against Muslims after 9/11, the support of President George W. Bush made them feel that those attacks were mostly from the fringe.

“With the recent spike in anti-Muslim sentiment nationwide and especially in the last few months since the Paris terror attacks and the San Bernardino attacks… there’s never been this level of fear and apprehension in the American Muslim community before,” said Ibrahim Hooper, spokesman for the Council of American-Islamic Relations. “Unfortunately now thanks to people like Donald Trump and Ben Carson, it’s directly in the mainstream.”

Against that background, leaders welcomed Obama’s visit as an important signal of the nation’s leader rejecting those attacks—and a message to Muslims that they belong in the United States.

“It means to us that we are a part of this society,” said Riham Osman, a spokeswoman for the Muslim Public Affairs Committee.

Obama took pains to condemn Islamophobic rhetoric during his State of the Union address in January. “When politicians insult Muslims, whether abroad or our fellow citizens, when a mosque is vandalized, or a kid is called names, that doesn’t make us safer,” he said. “That’s not telling it like it is. It’s just wrong. It diminishes us in the eyes of the world. It makes it harder to achieve our goals. It betrays who we are as a country.”

On Wednesday he responded to critics—especially Republican contenders to replace him in the White House—who complain that he won’t label Islamic terrorism as such, saying demands to label by religion only play into extremist propaganda.

“I often hear it said that we need moral clarity in this fight. And 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. “Let’s have some moral clarity: Groups like ISIS are desperate for legitimacy.... We must never give them that legitimacy. They’re not defending Islam. They’re not defending Muslims.”

Implicitly responding to tiresome calls for the “moderate Muslims” to speak out against terrorism, Obama said that they are speaking—but not enough people are listening. He vowed to work to amplify their voices.

But unlike in the past, when Obama has sometimes sought to question the Muslim bona fides of groups like ISIS, he acknowledged that the group draws its power in part from its interpretation of Islam—even if that interpretation is, as Obama said Wednesday, “perverted.” (That was a vast improvement on Secretary of State John Kerry’s baffling decision to label ISIS members “apostates” in comments Tuesday.)

Before speaking publicly, the president met with a group of Muslims: mostly young, foreign- and American-born, people born into Muslim families and converts, and from various ethnic backgrounds. Speaking specifically to young Muslims during his speech, Obama offered both reassurance that they belong in America, and a lecture on the importance of religious freedom. He said the government can’t deal with Muslim Americans simply through the lens of law enforcement, a nod to consistent complaints about intrusive policing and civil-liberties violations.

“You’re right where you belong. You’re part of America too. You’re not Muslim or American, you’re Muslim and American,” he told young Muslims. But Obama also warned them not to “respond to ignorance by embracing a worldview that suggests you must choose between your faith and your patriotism.”

This sort of language causes some discomfort among American Muslims. “There are a lot of young people in this mosque. It’s hard that they’ve grown up in a post-9/11 society where they are constantly tied to violent extremism,” Osman said. “It’s going to bring up some feelings.” The misgivings echo the complaints of African Americans who have applauded some of Obama’s interactions with the black community while rejecting his overtures to “respectability politics”—comments about how black men need to “pull up their pants” or make more effort to be present as fathers.

Shifting to address a global Muslim audience, Obama reiterated that the U.S. is not at war with Islam, and made a case for religious freedom worldwide. “Just as all Americans have a responsibility to reject discrimination ... Muslims around the world have a responsibility to reject extremist ideologies,” he said, highlighting in particular anti-Semitic attacks in Europe committed by Muslims.

Early in his remarks, Obama noted that many Americans have never been to a mosque, and tried to give them a picture of a vibrant community “Think of your own church or synagogue or temple. This is where families come to worship and express their love for God and each another,” he said, mentioned Cub Scout and Girl Scout meetings, basketball games, health clinics and more.

What Obama didn’t mention, but was apparent to all those meeting with him, was the fact that this was his own first visit in office to a mosque in the United States. While grateful for the president’s presence at this moment, Muslim leaders also wondered what took him so long.

“We’ve been advocating along with other Muslim organizations for years,” Osman said. As to the timing, she added, “That’s the question all American Muslims are asking now. We’re definitely not excusing him.”

Obama’s apparent reluctance to visit a mosque had become a symbol of the frustrations many Muslims felt toward the president. His entry into office was met with high hopes, and he won the backing of an overwhelming portion of the Muslim vote. American Muslims had backed Bush during his first run for office, but had become disenchanted with him after September 11, upset at wars in the Middle East and scrutiny by the national-security state at home. Many saw Obama as the man to fix it. He spoke during his campaign about the importance of civil liberties and improving relationships in the Muslim world, and he had even spent part of his childhood in Indonesia, the world’s largest predominantly Muslim country.

But Muslims have had their frustrations with the president since 2008. His actions in office haven’t matched his campaign rhetoric on civil liberties. The U.S. has remained involved militarily in the Middle East, and the administration’s vacillation and apparent helplessness in the face of the humanitarian disaster in Syria has frustrated many American Muslims. While polling data is less reliable that one would like, Obama’s support in the group seems to have dipped significantly in 2012—though it remained at nearly seven in 10.

That highlights the dilemma for American Muslims: Where else are they going go? As inattentive as Obama has been, some leading Republicans have become increasingly strident in their hostility to Islam—a tendency that seemed to increase significantly during the debate over the spuriously named “Ground Zero Mosque,” and which has only increased during the course of the 2016 presidential campaign. (Both Muslim members of Congress, Keith Ellison and Andre Carson, are Democrats, and both attended Wednesday’s event.)

Given that, Obama’s absence from American mosques—even as he visited foreign ones—had come to be seen as a symbol of how Obama carefully kept Muslims at arm’s-length. As early as 2011, U.S. Muslim leaders were expressing frustration that Obama hadn’t visited yet. “[He] has not spoken in any Muslim or Arab gathering that I know of, nor has he spoken in a mosque,” Imam Mohamed Magid told me then. “President Obama does all the speeches overseas.” Muslim leaders noted that American presidents as far back as Dwight Eisenhower had visited mosques, and spoke with increasing wistfulness about Bush, who—in an extraordinary gesture—had gone to the Islamic Center of Washington on September 17, 2001, just six days after the attacks in New York and D.C.

“The face of terror is not the true faith of Islam,” Bush said. “That's not what Islam is all about. Islam is peace. These terrorists don't represent peace. They represent evil and war. When we think of Islam we think of a faith that brings comfort to a billion people around the world.”

American Muslims tend to attribute Obama’s slowness to a combination of very real political pressure, including false suggestions that he is a Muslim, and a lack of political courage from the White House, which did not want to encourage those falsehoods. “I guess it’s natural human inclination to avoid even scurrilous attacks,” Hooper said.

The president acknowledged those attacks Wednesday: “Thomas Jefferson’s opponents tried to stir things up by suggesting he was a Muslim. I was not the first. Look it up! I’m in good company.”

Obama’s visit to the Islamic Society of Baltimore came after months of rumors that the president was finally ready to make an appearance, Osman said. MPAC learned of the visit two weeks ago, but ISB only got word last week, and invitations went out over the last two days.

A single visit to a mosque by Obama, at this late stage in his term, will not be enough to roll back the recent climate of fear. But even this late, tenuous visit represents an unusually strong step by an American leader to include the American Muslim community.