The clashes had centered around a military base, state media stations and the presidential mansion. President Joseph Kabila later went on television and said his power-sharing government, assembled after a devastating 1998-2002 war, was in control.
"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," Kabila said. "As for me, I'm fine."
The crisis was only the latest to shake Kabila's transition government, formed in 2003 from loyalists, ex-rebels and opposition figures.
Friday's coup attempt started after midnight local time, when an officer identified as Maj. Eric Lengue abruptly appeared on state radio to declare his forces had "neutralized" the transition government.
Power went off in the city, in a blackout suspected caused by the rebels. Foreign Minister Antoine Ghonda blamed an "isolated movement" within the security forces, and said dissidents included officers of Kabila's guard.
Government ministers said dissidents quickly yielded the state broadcast stations to loyalists, and retreated to a military base within the capital.
"The situation is completely under control," Information Minister Vital Kamerhe declared before dawn.
State TV and radio, retaken, repeated that message and urged Kinshasa's crowded capital to go about its day as normal.
Most of Kinshasa's millions appeared to have slept through the first hours of the coup attempt. At daybreak, however, the capital awoke to bursts of gunfire in the city center.
Residents and diplomats reported shooting and tank fire at the base where dissident forces had holed up.
Western diplomatic officials, speaking on condition of anonymity, said loyalist security forces were battling coup forces at the military base.
As shooting eased, British Ambassador Jim Atkinson told AP that Lengue, the alleged coup leader, had broken out of the base and was "possibly looking to give himself up."
Army Chief of Staff Adm. Mata Liwanga said only about 20 soldiers had accompanied Lengue to the camp. Twelve had been arrested, and the rest, including Lengue, were on the run, he said.
Tanks, armored personnel carriers loaded with troops, and troops on foot deployed in the heart of Kinshasa, sending residents running.
By midmorning, Lengue and his last followers were somewhere at Kinshasa's international airport, Ndjili, said presidential protocol officer Freddy Lugenda.
"The airport is under our control and we are looking through Ndjili," Lugenda said.
Simultaneously with the shooting around the base, residents and diplomats reported heavy gunfire around Kabila's private residence. There was no immediate explanation of the circumstances.
Friday's coup attempt was the second security-force uprising against the transition government led by Kabila, who took power in 2001 after his father, rebel-leader-turned-president Laurent Kabila, was killed by one of his own bodyguards.
In March, a few hundred soldiers attacked several military installations in the capital. That attempt was defeated, and it was unclear whether it was a coup attempt or a more limited mutiny.
On Wednesday, government forces recaptured the eastern town of Bukavu from renegade ex-rebel forces, ending a seven-day takeover that had posed the greatest military and diplomatic challenge to the government.
Kabila's government came under heavy criticism for allowing fall of the town June 2.