ACCRA, Ghana — President John Atta Mills vowed to help spread the wealth from Ghana’s newly discovered offshore oil fields, though his death Tuesday came before he could finish his first term in this West African nation long held up as a model of democracy.
His death came three days after his 68th birthday.
Chief of Staff John Henry Martey Newman told the nation that Mr. Atta Mills died Tuesday afternoon at the 37th Military Hospital in Accra, but gave no details about the cause.
‘‘It is with a heavy heart and deep sorrow that we announce the sudden and untimely death of the president of the Republic of Ghana,’’ Newman said.
The nation stood by for a speech by Vice President John Mahama, who will become president under the nation’s laws.
Chris Fomunyoh, senior director for Africa for the Washington-based National Democratic Institute for International Affairs, said that Ghana’s democracy could weather the death of a president.
In other nations in West Africa, the death of a ruler usually spells a coup, as it did in neighboring Guinea following the 2008 death of longtime dictator Lansana Conte, and Togo, where the military seized power after the president’s death in 2005 in order to install the leader’s son.
‘‘Ghanaian democracy has been tested, and its institutions function well,’’ said Fomunyoh. ‘‘There’s no reason to think that Ghana and its democracy will not handle this event properly.’’
Ghana — whose economy has been fueled by gold, cocoa, and timber exports in the past — hopes to put its oil money to good use, mindful of how nearby Nigeria suffered through military dictatorships and widespread corruption over its oil wealth.
Mr. Atta Mills was elected in a 2008 runoff vote, his third presidential bid, after campaigning on a platform of change, arguing that the country’s growth had not been felt in people’s wallets.
‘‘People are complaining; they’re saying that their standard of living has deteriorated these past eight years,’’ he said in 2008. ‘‘So if Ghana is a model of growth, it’s not translating into something people can feel.’’
Mr. Atta Mills even put up campaign posters of himself standing next to a cutout of President Obama in an effort to emphasize that he too stood for change.
In March, Mr. Atta Mills had traveled to the United States, where he met with Obama. The Ghanaian leader also traveled to the United States in April, as well, as rumors about his health began to circulate in Ghana.
Mr. Atta Mills won the 2008 second round ballot, capturing a razor-thin victory with 50.23 percent of the vote, or 4,521,032 ballots. His opponent, Nana Akufo-Addo, garnered 49.77 percent, or 4,480,446 votes.
Mr. Atta Mills also served as vice president under Jerry Rawlings, a coup leader who was later elected president by popular vote and surprised the world by stepping down after losing the 2000 election.
Mr. Atta Mills spent much of his career teaching at the University of Ghana. He earned a doctorate from London’s School of Oriental and African Studies before becoming a Fulbright scholar at Stanford University in Palo Alto, Calif.