CHARLESTON, S.C. (AP) — After a string of triumphs, President Barack Obama's eulogy for those killed in a South Carolina church massacre was supposed to bring an extraordinary week to a somber close.
But something changed.
Between legislative and legal victories, Obama had spent hours privately grappling with the tragedy in this southern city, where nine people attending Bible study were killed in a racially motivated attack. Their deaths sparked vexing questions about racial divisions, gun violence and the way America grapples with its own difficult history.
At first, the president had planned to largely focus his remarks on remembering Rev. Clementa Pinckney, the slain pastor of Emanuel African Methodist Episcopal Church, and the eight other victims.
But that's not what happened. Maybe Obama was buoyed by a week that brought about the validation of his sweeping health care law, a win on trade and the Supreme Court's affirmation of gay marriage across the country. Maybe he was driven by the fearlessness he says he now feels as he heads down the final stretch of his presidency.
As Obama took the stage to address the crowd of more than 5,500 packed into a basketball arena, he did speak movingly about Pinckney, a state lawmaker and popular pastor. Then the president issued a challenge, calling on the nation to not shy away from the "uncomfortable truths" about the racial prejudice that plagues the country.
He revived his push for gun control legislation, despite staunch opposition in Washington. He called for the Confederate battle flag to be removed from the grounds of South Carolina's statehouse, a move that would represent "one step in an honest accounting of America's history."
He taunted the alleged killer of the Charleston churchgoers. While the gunman wanted to incite fear and deepen divisions, Obama noted the unity Charleston has shown in the past week and said: "God works in mysterious ways. God had different ideas."
Then Obama sang.
As Obama neared the close of his 40-minute remarks, he unexpectedly sang out the opening words of the hymn "Amazing Grace." The crowd of 5,500 leapt to its feet to join the president in song.
It was a stirring emotional moment for a president who can often seem detached and distant.
The president has been in this position before, called upon to ease the pain of a community grieving after gun violence. Before Charleston, there were Newtown, Conn., Tucson, Ariz., Fort Hood, Texas, Aurora, Colo., Washington.
After each incident, the nation's eyes are sporadically open, Obama said. He challenged the nation to keep itself from slipping back "into a comfortable silence," saying that doing so would be "a betrayal of everything Rev. Pinckney stood for."
Following the service, Obama met privately with families of the victims. The president got to know Pinckney during the 2008 presidential campaign, when he was an early supporter of Obama.
Aides said Obama wrote much of the eulogy himself. He was still working on the speech Friday morning when his senior adviser Valerie Jarrett called to tell him the Supreme Court had given same-sex couples the right to marry nationwide.
The court ruling and memorial service capped an extraordinary week for a president seeking to stave off lame-duck status deep in his second term. With the help of Republican lawmakers, he secured a victory on legislation to speed up passage of an Asia-Pacific trade deal, one of his top foreign policy priorities. On Thursday, the Supreme Court upheld a key provision of his signature health care law, all but guaranteeing the law will survive beyond his presidency.
It's unknown how those victories and Obama's pledge to bring his presidency to a fearless finish will shape the closing months of his tenure. But the president summed up the feelings of a weary White House when Jarrett called.
"It's been a good week," Obama declared.