Ghana's former President Jerry John Rawlings has died at the age of 73.
He led two coups, first in 1979, before twice being elected president in multiparty polls.
A charismatic figure, he first seized power railing against corruption and was responsible for executing several former heads of state for their alleged graft and mismanagement.
He was also seen as a champion of the poor, but came to be criticised for alleged human rights abuses.
He died in hospital in the capital, Accra, after a short illness.
A week of national mourning has been announced in Ghana for the country's longest-serving leader, who oversaw the transition to multiparty elections in what is now one of Africa's most stable democracies.
John Mahama, presidential candidate of the National Democratic Congress (NDC), founded by Rawlings, has announced that he is suspending campaigning for next month's elections.
Who was Jerry Rawlings?
The son of a Scottish farmer and a Ghanaian mother, Rawlings entered the Ghana Air Force, graduating in 1969.
A decade later, as a senior officer in the air force, he overthrew a military government, handing over power to a civilian leader.
He oversaw the execution of several former heads of state and army generals for corruption, but expressed some regret about the killings. Later the execution by firing squad of Supreme Court judges also left a stain on his legacy.
"I am still aware that we in Ghana do not like bloodshed," he said at the time.
"I personally do not like it. I mean, I'd rather, let's say, confiscate a man's wealth and bring him down to the level to which he's brought us just to give him a taste of what life has been, what he's done to us."
In 1981, he led a second coup and was the head of a military junta until introducing multi-party elections in 1992, when he was first elected president.
He stepped down in 2001 after serving two terms but continued to wield a strong influence in the country.
He began his time in power as a committed socialist, but later introduced free-market reforms.
He ushered in a long period of political stability after a tumultuous series of coups in the 1960s and 1970s.
In later years, Rawlings campaigned for African nations to have their international debts written off.
African leaders pay their tributes
Ghana's President Nana Akufo-Addo, who is from a rival political party, announced seven days of national mourning. "A great tree has fallen, and Ghana is poorer for this loss," he said in a statement.
African Union Commission chairman Moussa Faki Mahamat said "Africa has lost a stalwart of Pan-Africanism and a charismatic continental statesman".
While Liberian President George Weah said "Ghana, Liberia and Africa will miss a great leader". "Liberia remembers his immense contribution to the attainment and sustainment of peace during our dark days of our own history," he added in a tweet.
Nigerian President Muhammadu Buhari said "the entire African continent will sorely miss the sterling qualities of the great leader".
"The passion, discipline and moral strength that the former Ghanaian leader employed to reposition his country over many years continue to reverberate across the continent and beyond," he said in a statement.