Former Obama Speechwriter Recounts the Real Story Behind 'Amazing Grace' Speech: 'Then He Began to Sing'

U.S.President Barack Obama speaks at the funeral of South Carolina State Senator and Rev, Clementa Pinckney at T.D. Arena in Charleston, South Carolina June, 26, 2015.
U.S.President Barack Obama speaks at the funeral of South Carolina State Senator and Rev, Clementa Pinckney at T.D. Arena in Charleston, South Carolina June, 26, 2015.
  • Oops!
    Something went wrong.
    Please try again later.
  • Oops!
    Something went wrong.
    Please try again later.
  • Oops!
    Something went wrong.
    Please try again later.

Tami Chappell/UPI/Shutterstock Funeral of Rev. Clementa Pinckney in Charleston, South Carolina, United States - 26 Jun 2015

While Barack Obama had a seasoned group of speechwriters helping him come up with the words to mark both celebratory and solemn occasions, the former president has well-known oratorial skills of his own. One of his most iconic speeches as president, in fact, was apparently all him.

That's according to Obama speechwriter Cody Keenan, who writes in his new book, Grace, that the now-iconic eulogy for Rev. Clementa Pinckney — delivered in the wake of the 2015 massacre that killed nine at the Emanuel AME Church — was straight from the president's heart.

As Keenan writes in his book, which was excerpted in Vanity Fair, the eulogy marked the 14th time President Obama would address the nation following a mass shooting. As such, the president and his staff weren't sure how much they could offer a grieving community.

"The next time this happens, I don't want to speak," Keenan recalls Obama telling him after Senate Republicans blocked a vote on universal background checks following the school shooting in Newtown, Conn.

So Keenan had his work cut out for him when it came to delivering a eulogy for a beloved South Carolina reverend — also a state senator — who was gunned down in an allegedly racially motivated spree.

RELATED: President Obama Sings 'Amazing Grace' to Conclude Eulogy for Slain Charleston Pastor

In a meeting ahead of the speech, Keenan writes that Obama determined he wanted to focus on "the concept of grace."

"But let's use it as a challenge," Obama continued, Keenan writes. "I don't want to congratulate ourselves too much when we as Americans just allow this s--- to keep happening. Talk about guns. Talk about the flag. Talk about the way hundreds of years of racial subjugation and segregation still shape the present. But leave room for the possibility of progress. Leave room for grace."

Keenan got to work, writing a roughly 2,000-word, four-page speech overnight. The next day, he heard from the president.

Obama, Keenan writes, had heavier edits than usual. Two of the four pages had been entirely stricken, with the other two full of handwritten notes.

"You gave me the scaffolding I needed to build something here," Obama told him. "You'll recognize your work in what I wrote."

Never miss a story — sign up for PEOPLE's free daily newsletter to stay up-to-date on the best of what PEOPLE has to offer.

The next day, the team was en route to Charleston for Obama to deliver the eulogy. After one more round of edits aboard Air Force One, the final version of speech was emailed to staff onsite, loaded onto a teleprompter and printed for the podium.

But there would be more revisions — these, however, would come from the president himself, while speaking onstage.

"You know, if it feels right, I might sing it," Keenan recounts Obama saying as he made his way off the plane that day.

What happened next was moving and historic.

Onstage at Charleston's TD Arena, Obama simultaneously memorialized the fallen pastor and called for Americans to examine race relations and gun control laws, using the concept of grace as a thread throughout the lengthy speech.

Near the end of the 39-minute speech, he got to the heart of the text.

"If we can tap that grace, everything can change," Obama said.

"Amazing grace," he continued, repeating the words once more for emphasis: "Amazing grace."

And then, he launched into the hymn, singing the opening lines of "Amazing Grace" before the entire congregation joined in.

"By the time Obama hit 'how sweet the sound,' the whole arena was singing with him," Keenan writes. "The organist jumped in at 'a wretch like me.' The drummer tapped his cymbals with a light touch, but so fast his sticks became a blur, creating a sustained swell of 'tsssssssssss.' The horn section began to blow. The guitarist uncorked a blues riff. Obama's bet, that he wouldn't be left alone, had paid off."

As Keenan recounts, the unrehearsed and unplanned moment was met with shock by White House staffers, who, "unaware of the plan Obama had revealed on Marine One, shouted at each other, 'Is he singing?' then ran to the entrance to the arena floor."

It wasn't Obama's first time singing onstage, as the former president made headlines when singing the opening bars of Al Green's "Let's Stay Together" at a fundraiser.

"But to sing this song, on this occasion, was something different altogether ... this was a much bigger stage," Keenan writes.