Obama and his half sister, Maya Soetoro-Ng, announced the news in a statement Monday.
"She was the person who encouraged and allowed us to take chances," they said. "She was proud of her grandchildren and great-grandchildren and left this world with the knowledge that her impact on all of us was meaningful and enduring. Our debt to her is beyond measure."
Fearing for her health, Obama left the campaign trail to visit the ailing Dunham in Hawaii on October 23rd and 24th. Dunham, who was 86, helped raise the Illinois senator. He praised her as the cornerstone of his family, "a woman of extraordinary accomplishment, strength, and humility."
The candidate learned of Dunham's death Monday morning while he was campaigning in Jacksonville, Florida. He planned to go ahead with campaign appearances.
The family said a private ceremony would be held later.
Obama said the decision to go to Hawaii was easy to make, telling CBS News that he "got there too late" when his mother died of ovarian cancer in 1995 at 53. He said he wanted to make sure "that I don't make the same mistake twice."
The McCain-Palin campaign offered their condolences in the following statement:
"We offer our deepest condolences to Barack Obama and his family as they grieve the loss of their beloved grandmother. 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 Kansas-born Dunham and her husband, Stanley, raised their grandson for several years so he could attend school in Honolulu while their daughter and her second husband lived overseas. Her influence on Obama's manner and the way he viewed the world was substantial, the candidate himself told millions watching him accept his party's nomination in Denver in August.
"She's the one who taught me about hard work," he said. "She's the one who put off buying a new car or a new dress for herself so that I could have a better life. She poured everything she had into me."
Obama's nickname for his grandmother was "Toot," a version of the Hawaiian word for grandmother, tutu. Many of his speeches describe her working on a bomber assembly line during World War II.
Madelyn and Stanley Dunham married in 1940, a few weeks before she graduated from high school. Their daughter, Stanley Ann, was born in 1942. After several moves to and from California, Texas, Washington and Kansas, Stanley Dunham's job landed the family in Hawaii.
It was there that Stanley Ann later met and fell in love with Obama's father, a Kenyan named Barack Hussein Obama Sr. They had met in Russian class at the University of Hawaii. Their son was born in August 1961, but the marriage didn't last long. She later married an Indonesian, Lolo Soetoro, another university student she met in Hawaii.
Obama moved to Indonesia with his mother and stepfather at age 6. But in 1971, her mother sent him back to Hawaii to live with her parents. He stayed with the Dunhams until he graduated from high school in 1979.
In his autobiography, Obama wrote fondly of playing basketball on a court below his grandparents' 10th-floor Honolulu apartment, and looking up to see his grandmother watching.
It was the same apartment Obama visited on annual holiday trips to Hawaii, a weekling vacation from his campaign in August, and his pre-election visit in October. Family members said his grandmother could not travel because of her health.
Madelyn Dunham, who took university classes but to her chagrin never earned a degree, nonetheless rose from a secretarial job at the Bank of Hawaii to become one of the state's first female bank vice presidents.
"Every morning, she woke up at 5 a.m. and changed from the frowsy muu-muus she wore around the apartment into a tailored suit and high-heeled pumps," Obama wrote.
After her health took a turn for the worse, her brother said on Oct. 21 that she had already lived long enough to see her "Barry" achieve what she'd wanted for him.
"I think she thinks she was important in raising a fine young man," Charles Payne, 83, said in a brief telephone interview from his Chicago home. "I doubt if it would occur to her that he would go this far this fast. But she's enjoyed watching it."
Stanley Dunham died in 1992, while Obama's mother died in 1995. His father is also deceased.
When Obama was young, he and his grandmother toured the United States by Greyhound bus, stopping at the Grand Canyon, Yellowstone Park, Disneyland and Chicago, where Obama would years later settle.
It was an incident during his teenage years that became one of Obama's most vivid memories of Toot. She had been aggressively panhandled by a man and she wanted her husband to take her to work. When Obama asked why, his grandfather said Madelyn Dunham was bothered because the panhandler was black.
The words hit the biracial Obama "like a fist in my stomach," he wrote later. He was sure his grandparents loved him deeply. "And yet," he added, "I knew that men who might easily have been my brothers could still inspire their rawest fears."
Obama referred to the incident again when he addressed race in a speech in March during a controversy over his former pastor, the Rev. Jeremiah Wright. "I can no more disown him than I can my white grandmother," he said.
Dunham was "a woman who loves me as much as she loves anything in this world but who once confessed her fear of black men who passed her on the street."
Still, much of who Obama is comes from his grandmother, said his half sister.
"From our grandmother, he gets his pragmatism, his levelheadedness, his ability to stay centered in the eye of the story," she told The Associated Press. "His sensible, no-nonsense (side) is inherited from her."
Madelyn Lee Payne was born to Rolla and Leona Payne in October, 1922, in Peru, Kan., but lived much of her childhood in nearby Augusta.
She was the oldest of four children, and she loved to read everything from James Hilton's "Lost Horizon" to Agatha Christie's "The Murder of Roger Ackroyd."
Dunham and her husband were "vicious" bridge players, according to her brother Jack. After retirement, the two of them would take island cruises and do little but play bridge and a more difficult version called duplicate bridge.