Tens of thousands of people in the Ghanaian capital Accra have attended the state funeral for President John Atta Mills, who died suddenly in July.
Some 18 African heads of state and US Secretary of State Hillary Clinton witnessed the ceremony in Accra's Independence Square.
Mills, who had long suffered from throat cancer, died only five months before he was set to seek re-election.
A BBC reporter in Accra says his death has united Ghanaians in grief.
She says his death was seen as a test for the country's young democracy.
Mills, who started a four-year term in January 2009, was succeeded by Vice-President John Dramani Mahama.
Ghana has won international plaudits for the swift manner in which it handled the transition in a nation known for its divisive politics.
Today a dark cloud hangs over Ghana, over Africa and indeed over the entire world," Mr Mahama told the thousands of mourners who were able to watch the proceedings on large television screens set up around the square.
"President Mills was the very embodiment of what has been missing from our politics - civility, humility in service, honesty," he said.
The BBC's Vera Kwakofi says people began gathering before dawn in and around Independence Square, dressed in the official colours of mourning - black and red.
Most of the traditional chiefs attended along with their own drummers who pounded out personal messages of grief, she says.
In front of the drummers, dancers performed - the twisting of their hands and arms all had symbolic meanings.
When the military band and cortege carrying the coffin entered the square, the drumming, praise singing and warrior songs stopped, our reporter says.
Mournful flutes played while President Mahama lit the perpetual flame of remembrance for the late president, who was often referred to as "The Prof" - a reference to his long academic career - and "Asumdwoehene", meaning prince of peace in the Twi language.