CHARLESTON, S.C. (CBSNewYork/AP) — President Barack Obama delivered a passionate discourse on America’s racial history Friday in his eulogy for one of the victims of a deadly shooting at an African-American church in Charleston, South Carolina.

“What a life Clementa Pinckney lived!” Obama said to rounds of applause. “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.”

READ MORE: Overnight Gun Violence: 3 Men Shot In Queens, Innocent Woman Shot In Brooklyn, NYPD Says

Rev. Clementa Pinckney and eight parishioners of the Emanuel African Methodist Episcopal Church were gunned down during a Bible study session last week in what authorities are investigating as a racially motivated attack.

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

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,” the president said. “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.

“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 continued, 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 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.

Friday’s service for Rev. Pinckney, who was also a state senator, was another wrenching but cathartic occasion for the community to say goodbye to the victims.

The first two funerals, for Ethel Lance and Newark native Sharonda Coleman-Singleton, were held Thursday, with tight security and emotional responses to the eulogies and hymns.

Attendees included South Carolina Gov. Nikki Haley, Charleston Mayor Joe Riley, U.S. Rep. Mark Sanford, the Rev. Jesse Jackson and the Rev. Al Sharpton.

Sharpton noted that on the day of the shootings, he was in Washington watching Loretta Lynch being sworn in as the nation’s first black female attorney general.

READ MORE: NYPD: Suspect In Custody For Possible DWI After Injuring Officer At Traffic Checkpoint In Lower Manhattan

“That morning, I saw how far we have come,” Sharpton said. “That night,” after the shooting, “I saw how far yet we have to go.”

Police officers stood guard and checked bags as mourners filed in for the funerals, which were held as the debate over the Confederate flag and other Old South symbols continued around the region. A growing number of leading politicians said Civil War symbols should be removed from places of honor, despite their integral role as elements of Southern identity.

“A hateful, disillusioned young man came into the church filled with hate — and the reaction was love,” Riley said at the funeral for Coleman-Singleton, 45. “He came in with symbols of division. The Confederate battle flag is coming down off our state Capitol.”

Before the second service, more than 100 members of Coleman-Singleton’s Alpha Kappa Alpha sorority formed a ring around the main part of the large sanctuary as part of an Ivy Beyond the Wall ceremony. One by one, the women, clad all in white, filed past the open casket with green ivy leaves, then clasped hands and sang.

Last week, Coleman-Singleton’s family told CBS2 that she was perfect in every way – inside and out.

“She was love. She was love,” said her sister, Jacqueline Askew. “She still is love.”

Lance had served as a sexton at Emanuel for the past five years, helping to keep the historic building clean. She loved gospel music, watched over a family that grew to include her five children, seven grandchildren and four great-grandchildren, and pushed them to earn advanced degrees.

“I want my grandmother’s legacy to be what she stood for,” said granddaughter Aja Risher. “She is going to be a catalyst for change in this country.”

Haley started the groundswell against Confederate icons Monday by successfully calling on South Carolina lawmakers to debate taking down the Confederate battle flag flying in front of the Statehouse. Then Alabama Gov. Robert Bentley, also a conservative Republican, brought down four secessionist flags at the Capitol in Montgomery.

Some authorities have worried openly about a backlash as people take matters into their own hands.

“Black Lives Matter” was spray-painted on a monument to Confederate President Jefferson Davis in Richmond, Virginia, on Thursday, only the latest statue to be defaced. On Tuesday and Wednesday, African-American churches in Charlotte, North Carolina; and Macon, Georgia; were intentionally set afire.

But in Charleston, the early gestures of forgiveness by the victims’ families toward a shooting suspect who embraced the Confederate flag set a healing tone that has continued through a series of unity rallies.

The suspect, 21-year-old Dylann Storm Roof, appears with a Confederate license plate, waving a Confederate flag, burning and desecrating U.S. flags, posing at Confederate museums and with the wax figures of slaves on a website created in his name months before the attacks.

Attorney Boyd Young, who represents Roof’s family, issued a statement saying they will answer questions later, but want to allow the victims’ families to grieve. “We feel it would be inappropriate to say anything at this time other than that we are truly sorry for their loss,” the statement said.

MORE NEWS: Man Arrested After Allegedly Attacking, Trying To Choke 11-Year-Old Girl At Manhattan Park

(TM and © Copyright 2015 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2015 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)