Togo's President Gnassingbe Eyadema, Africa's longest serving ruler, has died and was replaced hours later by his son, Faure, army officials said.
Eyadema rose to power in a military coup
Eyadema, 69, who had been ill for a number of years, died while being evacuated for medical treatment abroad.
The army said the speaker of parliament, who - under the West African country's constitution - should take over, was out of the country.
The Africa Union has denounced the move as a military coup.
All land and air borders have reportedly been closed.
Army chief of staff Gen Zakari Nandja said the decision to hand power to Faure Eyadema as acting president had been taken to avoid a power vacuum, with speaker, Fambare Ouattara Natchaba, away.
Faure Eyadema is the current communications minister.
AU commissioner Alpha Oumar Konare said it was a military coup, and an adviser to the AU's chairman, Nigerian President Olusegun Obasanjo, said such an unconstitutional transfer of power was unacceptable.
Eyadema had ruled since 1967, when he rose to power in a military coup.
The announcement of his death was made by Prime Minister Koffi Sama.
"It is a national catastrophe. The president of the republic, Gnassingbe Eyadema, is no more," he said.
"The government, the armed forces and security forces will keep watch so that order, security and peace reign throughout the country."
Eyadema had travelled abroad on several occasions in recent years for medical treatment.
After seizing power 38 years ago, Eyadema dissolved all political parties and governed unchallenged for more than two decades.
He legalised political parties in 1991, as a result of popular pressure, and won three elections.
But accusations of political repression and electoral fraud continued.
The European Union suspended aid in 1993 in protest at alleged voting irregularities, although some ties have since been restored.
An investigation by the United Nations and the Organisation of African Unity, after disputed elections in 1998, concluded there had been systematic violations of human rights.
Recently, Eyadema had tried to change his political image by appearing more moderate and attempting to involve himself in peace moves elsewhere in the region.
However, these attempts were largely unsuccessful, says the BBC's Andrew Simmons in Senegal.