President Joseph Kabila of the Democratic Republic of Congo has appeared on national television, saying that a coup attempt has been thwarted.
This is the second coup attempt this year
There was heavy gunfire in the capital, Kinshasa, after rebel soldiers seized the national TV station overnight.
Artillery and heavy weapons were heard near Mr Kabila's residence and in several other districts.
This is the latest challenge to a power-sharing government set up last year to end five years of war.
Mr Kabila's security advisor Mulegwa Zinhindula told the BBC's Focus on Africa programme that the "coup attempt" was not linked to last week's rebel capture of the eastern town of Bukavu.
"Stay calm, prepare yourself to resist - because I will allow nobody to try a coup d'etat or to throw off course our peace process," Mr Kabila said, wearing military fatigues.
"As for me, I'm fine."
He said that 12 people had been arrested.
The alleged coup leader, Major Eric Lenge, has fled the city, said Mr Kabila's spokesman Kudura Kasongo.
"He is heading towards the province of Bas Congo. He has 21 well-armed men with him. The army, supported by a helicopter, is chasing him," Mr Kasongo told Reuters news agency.
The gunfire is now reported to have ended and the United Nations Mission in DR Congo (Monuc) said there were no reports of unrest outside the capital.
The British ambassador in Kinshasa, Jim Atkinson, said he had heard artillery fire coming from Camp Tshatshi, Kinshasa's biggest military base, situated on the outskirts of the city on the banks of the Congo river.
At 0230 local time (0130 GMT), some renegade soldiers from the presidential guard took over state television and announced that the army was in control.
But the BBC's Arnaud Zajtman in DR Congo says that television is normally off air at that time and so the announcement went largely unheard.
Troops loyal to the government retook the station soon after, Foreign Minister Antoine Ghonda told the BBC.
The mutineers also cut off electricity to Kinshasa for some three hours.
Our correspondent says that Maj Lenge is believed to be close to Mr Kabila and to some hardliners who have no seats in the current government of unity.
Analysts in Kinshasa say that the "coup attempt" could have been engineered by the hardliners, to change the balance of powers within the Congolese government.
The government is made up of former belligerents who have fought against each other over five years of war and are due to organise elections next year.
There was another coup attempt in March and much of the east remains unstable, despite the presence of some 10,000 UN peacekeepers.
On Wednesday, government troops retook the town of Bukavu, which had been under rebel control for a week.