ACCRA, Ghana (AP) – President John Atta Mills’ election victory secured Ghana’s reputation as one of the most stable democracies in West Africa, though his death Tuesday came before the 68-year-old could finish his first term in office.

Hours later, Vice President President John Mahama took the oath of office, further underscoring Ghana’s stability in a region where the death of a leader can spark a coup attempt.

Ghanaian state-run television stations GTV and TV3 broke into their regular programming to announce the president’s death Tuesday afternoon, which came three days after his 68th birthday.

Mahama was sworn in as president by 8:15 p.m., raising the golden staff of office above his head only six hours after Atta Mills’ death.

Ghana had “been hit by an unprecedented tragedy” Mahama said, adding that the late leader “gave himself to bettering the lives of the people of this country.”

Chief of Staff John Henry Martey Newman told the nation that Atta Mills had died at the 37th Military Hospital in Accra but gave no details about the cause. Rumors had swirled about his health after he made several trips to the United States in recent months.

“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.

On the streets of Cape Coast, 80 miles from Accra, people held radios to their ears on the street, listening to the funeral hymns playing on FM stations and waiting for more information about the president’s unexpected death.

“His speeches were full of a spirit of love and peace,” said Efua Mensima, 45. “He was soft-spoken. I wept when I heard of his death.”

In a predominantly Ghanaian section of Ivory Coast‘s commercial capital, 10 men gathered just outside the home of Nour Ousmane Aladji, monitoring radio reports Tuesday night and trying to organize a bus to take them to Ghana for the president’s funeral.

“The Ghanaian people were happy with this president and his program for the development of the country,” said Aladji, 27, a taxi driver who moved to Abidjan in 2000. “Frankly, we liked him. Since his arrival everything he undertook was for the well-being of the country and his countrymen.”

Chris Fomunyoh, the 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.

Atta Mills was elected in a 2008 runoff vote that was the closest in the country’s history — and his third presidential bid. The election also marked the country’s second successful handover of power from one legitimately elected leader to another.

He campaigned 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 told The Associated Press in 2008. “So if Ghana is a model of growth, it’s not translating into something people can feel.”

Seth Arthur, 29, who works at a hotel, said he voted for Atta Mills and believes he needed more time to fulfill his promises.

“He wasn’t 100 percent successful though he tried. He tried.”

Richard Downie, the deputy director of the Africa program at the Center for Strategic and International Studies in Washington, said that Atta Mills may be remembered less for who he is or what he did, and more for what his election in 2008 symbolized.

He defeated the ruling party by the slimmest of margins, marking two successful handovers of power in Ghana, a benchmark used by political scientists to measure a mature democracy.

“It showed just how robust Ghana’s democracy was, and it proved here in the U.S. what a success Ghana had become in terms of its political maturity,” he said.

Atta Mills had traveled to the U.S. in March where he met with Obama, whose administration offered its condolences Tuesday.

Opposition newspapers had recently reported he was not well enough to run for a second term.

Last month when he went to the U.S., some radio stations reported that he was dead. When Atta Mills returned to Ghana, he jogged at the airport and blasted those who had reported his death

A government official in neighboring Ivory Coast said that he saw Atta Mills around six months ago in Ethiopia during an African Union meeting.

“We are hearing that he died of cancer of the throat. I saw him in Addis Ababa— not this meeting, but the one maybe six months ago,” said the official, who requested anonymity because he was not authorized to speak to the press. “He was walking slowly. I am surprised to learn that he is only 68. He looked much older.”

Still, the official said no one suspected he was gravely ill. “Yes, his death is a surprise — it’s six months before the election, and he was a candidate.”

He 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.

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 the 2000 vote.

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, California.