ACCRA (AFP) - Ghana President John Atta Mills died suddenly Tuesday, hours after being taken ill and months before he was to seek re-election in a country seen as a bastion of democracy in west Africa.
The 68-year-old Mills, who oversaw the start of large-scale oil production in Ghana in December 2010, had recently traveled to the United States for a medical check-up. His cause of death was not given.
In accordance with Ghana's constitution, Vice President John Dramani Mahama was sworn in as president before an emergency session of parliament, pledging to maintain stability as he serves out the remainder of Mills' term.
"I wish Ghanaians to be assured that all is well," the 53-year-old who has also served as communications minister and recently published a memoir said. "We are going to maintain the peace, unity and stability that Ghana is noted for."
He declared a week of national mourning, with flags to be flown at half-mast.
Mills died in a hospital in the capital Accra while receiving treatment, his office said. While the cause was not specified, he had shown signs of illness, including recently losing his voice and a gradual loss of weight.
His recent visit to the United States was officially for a routine medical check-up.
There were unconfirmed reports in local media that he had suffered throat cancer, while false rumours of his death had also previously spread.
Presidential elections are set for December in a country seen as a rare example of a stable democracy in west Africa and which recently joined the ranks of the world's large-scale oil producers.
Mills was to be the ruling party's candidate after fending off an unprecedented challenge for the nomination.
Condolences poured in for the late leader, including from US President Barack Obama who chose Ghana for his first visit to sub-Saharan Africa as president in 2009.
"President Mills tirelessly worked to improve the lives of the Ghanaian people," Obama said in a statement.
"He helped promote economic growth in Ghana in the midst of challenging global circumstances and strengthened Ghana's strong tradition of democracy."
West African leaders, including those in Nigeria, Ivory Coast and Togo, also paid tribute to Mills, while UN chief Ban Ki-moon praised his "statesmanship."
The capital Accra was sombre, with activity slowing and residents gathering in the streets to discuss the news.
Emmanuel Bombande, executive director of the the Accra-based West Africa Network for Peacebuilding, said "people have a lot of faith in the Ghananian constitution", adding that he trusted the transition would be an orderly one.
"It was a total surprise, although ordinary people knew that the president had not been 100 percent well," he said, mentioning Mills' recent trip to the United States. Bombande called the late president "a man of integrity".
Pindana Mohammed, a market trader in the capital, said he was shocked by the news which he heard on the radio.
"I am not a supporter of the ruling government, but I respect so much the president because of the way he carried himself," he said.
Mills took over as Ghana's president in January 2009.
He narrowly won the vote in 2008 with a less than one percent margin against a candidate from the party of incumbent John Kufuor, widely respected for having bowed out following his two terms in office.
In July last year, Mills was nominated to be the ruling National Democratic Congress party's presidential candidate for the December 2012 elections.
The primary represented the first time in the country's history that a sitting president competed for his own party's nomination.
Mills beat his only rival in the party primary, Nana Konadu Agyemang Rawlings, the wife of ex-military leader Jerry Rawlings.
Mills rose to prominence in 1997 when Rawlings named him vice president -- a position he held until the former coup leader-turned-elected president made way for Kufuor after the 2000 elections.
After finishing his law studies in Britain, Mills came home to teach law for 25 years at a Ghana university.
Ghana, a country of some 25 million people, recently joined the ranks of the world's large-scale oil producers.
The country has begun producing oil from its offshore Jubilee field, one of the largest discoveries in West Africa in recent years. The field's operator Tullow has estimated that the field's recoverable resources amount to up to one billion barrels.