Obama announced the news from the campaign trail in Charlotte, N.C. The joint statement with his sister Maya Soetoro-Ng said Dunham died late Sunday night after a battle with cancer.
"She's gone home," Obama said as tens of thousands of rowdy supporters at the University of North Carolina-Charlotte grew silent in an evening drizzle.
"And she died peacefully in her sleep with my sister at her side. And so there is great joy as well as tears. I'm not going to talk about it too long because it is hard for me to talk about."
But he said he wanted people to know a little about her — that she lived through the Great Depression and World War II, working the latter on a bomber assembly line with a baby at home and a husband serving his country. He said she was humble and plain spoken, one of the "quiet heroes that we have all across America" working hard and hoping to see their children and grandchildren thrive.
"That's what we're fighting for," Obama said.
Obama learned of Dunham's death Monday morning while he was campaigning in Jacksonville, Fla. He went ahead with campaign appearances. The family said a private ceremony would be held later.
"So many of us were hoping and praying that his grandmother would have the opportunity to witness her grandson become our next president," said Hawaii state Rep. Marcus Oshiro, an Obama supporter. "What a bittersweet victory it will be for him. Wow."
Republican John McCain issued condolences to his opponent. "Our thoughts and prayers go out to them as they remember and celebrate the life of someone who had such a profound impact in their lives," the statement by John and Cindy McCain said.
Last month, Obama took a break from campaigning and flew to Hawaii to be with Dunham as her health declined.
Obama said the decision to go to Hawaii was easy to make, telling CBS that he "got there too late" when his mother died of ovarian cancer in 1995 at 53, and wanted to make sure "that I don't make the same mistake twice."
Outside the apartment building where Dunham died, reporters and TV cameras lined the sidewalk as two police officers were posted near the elevator. Signs hanging in the apartment lobby warned the public to keep out.