CHARLESTON, S.C. (AP) — President Barack Obama delivered a passionate discourse on America’s racial history Friday in his eulogy for a state senator and pastor slain in what police called a racial attack on a historic African-American church.

“What a life Clementa Pinckney lived,” Obama said to rounds of applause and “amens.” ”What an example he set. What a model for his faith. And then to lose him at 41. Slain in his sanctuary with eight wonderful members of his flock.”

“Their church was a sacred place,” Obama said, “not just for blacks, or Christians, but for every American who cares about the expansion of liberty. … That’s what the church meant.”

Thousands of mourners eagerly awaited Obama’s speech, which came in a week of sorrowful goodbyes and stunning political developments. The slayings inside the Emanuel African Methodist Church have prompted a sudden reevaluation of the Civil War symbols that were invoked to assert white supremacy during the South’s segregation era.

Pinckney came from a long line of preachers and protesters who worked to expand voting rights across the South,Obama said. “In the pulpit by 13, pastor by 18, public servant by 23. He set an example worthy of his position, wise beyond his years.”

“We do not know whether the killer of Rev. Pinckney knew all of this history. But he surely sensed the meaning of his violent act. It was an act that drew on a long history of bombs, and arsons, and shots fired at these churches; not random, but as a means of control, a way to terrorize and oppress,” the president said.

“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, his voice rising in the cadence of the preachers who preceded him.

“Oh, but God works in mysterious ways!” Obama said, and the crowd rose to give him a standing ovation. “God has different ideas!”

Obama then spoke plainly about the ugliness of America’s racial history — from slavery to the many ways that minorities have been deprived of equal rights in 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 in song, belting out the first chorus of “Amazing Grace” as the choir and organist joined in. America’s first black president sang this spiritual, less than a mile from the spot where thousands of slaves were sold and where South Carolina signed its pact to leave the union a century and a half earlier.

Watch the full eulogy, via MSNBC:



—

Associated Press Writer Jeffrey Collins contributed from Columbia, S.C.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.