President Barack Obama pauses while speaking in the Brady Press Briefing Room of the White House in Washington, Thursday, June 18, 2015, on the church shooting in Charleston, S.C., prior to his departure to Los Angeles. (AP Photo/Manuel Balce Ceneta) more >

President Obama said Friday he isn’t surrendering on gun-control efforts.

“I’m not resigned,” Mr. Obama told the U.S. Conference of Mayors in San Francisco. “I have faith we will eventually do the right thing.”

Referring to the murders of nine people Wednesday at a black church in Charleston, South Carolina, Mr. Obama again said the U.S. is setting a shameful example to the rest of the world about gun violence.

“We have to stop being confused about this,” he said. “You don’t see murder on this kind of scale, this kind of frequency in any other advanced nation on Earth. I refuse to act as if this is the new normal, or to pretend that it’s simply sufficient to grieve, and that any mention of us doing something to stop is somehow politicizing the problem.”

Mr. Obama also said racism played an obvious role in the shooting deaths. The alleged gunman is a 21-year-old white man.

“Racism remains a blight we have to combat together,” Mr. Obama said. “We’ve made great progress … but we need to be vigilant, because it lingers … and it betrays our ideals and tears our democracy apart.”