He was speaking of Dylann Roof, a young white supremacist and accused killer.
"It was an act that he imagined would incite fear, and incrimination, violence, and suspicion. An act he presumed would deepen divisions that trace back to our nation's original sin," Obama said with the cadence of a preacher.
"Oh, but God works in mysterious ways! God has different ideas!" From the Associated Press account:
Obama then spoke plainly about the ugliness of America's racial history—from slavery to the many ways minorities have been deprived of equal rights in more recent times. Removing the Confederate battle flag from places of honor is a righteous step toward justice, he said. "By taking down that flag, we express God's grace. But I don't think God wants us to stop there," Obama said, smiling as the crowd laughed with him.
The president wrapped up the four-hour funeral in song, belting out the first words of "Amazing Grace" all by himself. The choir, organist, and many in the audience stood up and joined him.
Slain along with Pinckney were Cynthia Hurd, 54; Tywanza Sanders, 26; Sharonda Singleton, 45; Myra Thompson, 59; Ethel Lance, 70; Susie Jackson, 87; the Rev. Daniel Simmons Sr., 74; and DePayne Doctor, 49.
Obama named them one by one, shouting that each "found that grace!"
He praised Republican Gov. Nikki Haley for leading the effort to remove the Confederate flag outside South Carolina's statehouse.
"It's true the flag did not cause these murders," Obama said. "But as people from all walks of life, Republicans and Democrats, now acknowledge—Governor Haley's recent eloquence on the subject is worthy of praise—as we all have to acknowledge, the flag has always represented more than just ancestral pride.
"Removing the flag from this state's capitol would not be an act of political correctness. It would not be an insult to the valor of Confederate soldiers. It would simply be an acknowledgment that the cause for which they fought—the cause of slavery—was wrong. The imposition of Jim Crow after the Civil War, the resistance to civil rights for all people, was wrong.
"It would be one step in an honest accounting of America's history, a modest but meaningful balm to so many unhealed wounds," he said. "It would be an expression of the amazing changes that have transformed this state and this country for the better."
As a nation, out of terrible tragedy, Obama said, "God has visited grace upon us. For He has allowed us to see where we've been blind."
In addition to race relations, Obama said the nation should address problems such as gun violence, poverty, and police-community relations, especially in African-American communities. Obama said people should guard against not just "racial slurs," but also "the subtle impulse to call Johnny back for a job interview—but not Jamal."