President Barack Obama, speaking in Baltimore County on Wednesday during his first visit to a U.S. mosque as president, urged Americans to embrace their “common humanity” and reject the “inexcusable political rhetoric” he said is emanating from the presidential campaign trail.

Obama spoke of the role Islam has played in the nation's history, and decried a rise in rhetoric and violence directed against Muslims since the deadly attacks in Paris and San Bernardino, Calif.

He called on the religion's leaders, meanwhile, to speak out against extremism. “We're one American family,” Obama told an audience at the Islamic Society of Baltimore in Catonsville, one of the largest and most influential mosques in the Mid-Atlantic.

“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.”

Though Obama touched on the presidential election only tangentially, White House aides said he decided to speak at the mosque largely to counter statements and policies floated by Republican candidates in recent months.

Billionaire Donald Trump, in particular, has stirred controversy by proposing to bar Muslims from entering the country.

“Recently, we've heard inexcusable political rhetoric against Muslim Americans that has no place in our country,” Obama said. “We have to reject a politics that seeks to manipulate prejudice or bias, and targets people because of religion.”

The 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

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 mosque where Obama chose to deliver that message has grown from a small gathering of doctors at the Johns Hopkins University in 1969 into a massive campus near Catonsville with thousands of worshipers, a school, medical facilities and a Girl Scout troop.

Obama described the Islamic Society of Baltimore as an “All-American story.”

The mosque has come under scrutiny from some conservative websites since the White House announced the trip. Those outlets have focused on a former imam, Mohamad Adam El Sheikh, who was quoted by The Washington Post in 2004 as saying that suicide bombings might be acceptable in extreme circumstances.

El Sheikh told The Baltimore Sun this week that he never condoned suicide attacks, and White House officials dismissed the stories as political attacks.

“This is a faith community that regularly speaks out against extremism,” White House spokesman Josh Earnest told reporters before the president spoke. “If it elevates the president's visit and elevates the president's message of protecting religious liberty ... then our opponents should keep it up.”

The society has been visited by Republican elected officials, too, with virtually no controversy. When Gov. Robert L. Ehrlich Jr. toured the campus in 2002, a year after the attacks of Sept. 11, 2001, hardly anyone noticed.

Muhammad Abdur-Rahman, who sits on the society's school board, said the report of El Sheikh's statements “was news to us.”

“It's not a part of our faith,” he said. “It's not something that we tolerate.”

Muslims are estimated to make up nearly 1 percent of the U.S. population. Muslims and others say they have seen discrimination and hostility increase after last year's attacks in California and France.

“I know that in Muslim communities across our country, this is a time of concern and, frankly, a time of some fear,” Obama said. “We've seen children bullied. We've seen mosques vandalized.”

The event was a personal milestone for the president with an 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 Obama is a Muslim.

Obama quoted from the Quran to reinforce a point about religious harmony: “We have made you people of tribes,” he said, “so you may know one another.”

A small group of onlookers gathered in the cold and rain outside to watch the president's motorcade arrive. Mujahiddeen Mohammed, 31, brought his family from Philadelphia.

He huddled under an umbrella with his sleeping son. He chose to see the drizzle as an auspicious sign.

Muslims see rain on a funeral as washing away the sins of the departed, Mohammed said. He thought the rain and the president's visit marked the death of racism and intolerance.

The presidential motorcade rolled up Johnnycake Road just after 11 a.m., passing a few protesters waving signs about the Palestinian militant organization Hamas.

A Christian preacher spoke through a megaphone. “Jesus Christ is Lord,” he said. “Hallelujah!”

The man, who declined to give his name, had spent much of the morning denouncing Islam as a false religion.

Colin Christopher, the executive director of a Washington-based environmental group called Green Muslims, was one of a dozen community leaders who spoke with Obama in a closed-door meeting at the mosque. White House officials said the participants were chosen for the contributions they have made to their communities.

Christopher said participants shared stories of “feeling bothered and discriminated against and fear from neighbors and constantly under surveillance.”

“This has happened to most of us at some level,” he said.

Another participant, Baltimore resident Saafir Rabb, likened the struggle Muslim Americans are facing now to the conditions that led to the civil rights movement.

“There was a time when bigotry and hatred prevailed in American rhetoric, and over time it was corrected,” said Rabb, the founder of a consulting company.

“It is our intention to work hard and ardently to correct it again.”

Tribune Newspapers Washington correspondent Christi Parsons contributed to this article.

jfritze@baltsun.com

idunca@baltsun.com