Charleston - President Barack Obama delivered a passionate discourse on America's racial history on Friday and then broke into song during a eulogy for a state senator and pastor, slain along with eight other black churchgoers in what police called a hate crime."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."His 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 capped a week of sorrowful goodbyes and stunning political developments. The slayings inside the Emanuel African Methodist Church last week have prompted a sudden re-evaluation 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."We do not know whether the killer of Reverend 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.God has different ideas"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 honour 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."For too long, we've been blind to the way past injustices continue to shape the present. Perhaps we see that now. Perhaps this tragedy causes us to ask some tough questions."The president wrapped up the four-hour funeral in song, belting out the first chorus of a famous Christian hymn, Amazing Grace, solo before the choir and organist joined in. America's first black president sang this spiritual less than a mile from the spots where thousands of slaves were sold and where South Carolina signed its pact to leave the union a century and a half earlier.The "Mother Emanuel" church choir, hundreds strong, led roughly 6 000 people through rousing gospel standards between speakers who celebrated the legacy of state Senator Clementa Pinckney and his fellow churchgoers.Wrong place"Someone should have told the young man. He wanted to start a race war. But he came to the wrong place," The Right Reverend John Richard Bryant, a top religious leader with the African Methodist Episcopal Church, said to rounds of applause. A banner alongside Pinckney's closed coffin declared "WRONG CHURCH! WRONG PEOPLE! WRONG DAY!"Applause also rang out as state Senator Gerald Malloy, Pinckey's Senate suitemate and his personal lawyer, noted how the slayings have suddenly prompted a re-evaluation of Civil War symbols that were invoked to assert white supremacy during the South's segregation era."All the change you wanted to see and all the change you wanted to do - because of you, we will see the Confederate flag come down in South Carolina," Malloy said.Obama and Vice President Joe Biden sang and clapped along as they sat with relatives of the victims in the front row. Also attending were first lady Michelle Obama, Jill Biden, and dozens of prominent lawmakers and civil rights leaders.Justice Department officials broadly agree that the shootings inside the Emanuel African Methodist Episcopal Church meet the legal requirements for a hate crime, meaning federal charges are likely, a federal law enforcement source told The Associated Press on Thursday, speaking on condition of anonymity because the investigation is ongoing."I'm here to hear Obama speak hopefully on racism, forgiveness and justice," said Wannetta Mallette, who attend the event. "I think everyone is here to share in the grief and sorrow," she said.The revelation that shooting suspect Dylann Storm Roof had embraced Confederate symbols before the attack, posing with the rebel battle flag and burning the US flag in photos posted online, prompted the stunning turnaround, despite the outsized role such symbols have played in Southern identity.Obama praised the governor of South Carolina for moving first by asking lawmakers to bring down the flag outside South Carolina's Statehouse. Other politicians then leaped through that opening, saying that historic but divisive symbols no longer deserve places of honour.