The authorities claimed that all pockets of active fighting had been put down by Friday, a day after the attacks on the Caucasus Mountains city of Nalchik began, but concern was high that fighters could have melted into the civilian population to regroup.
President Vladimir Putin promised that Russia would put down all attacks "hard and consistently", but the bloodshed underlined how violence in the restive Caucasus region is spreading.
As officials announced the Russian operation as successful on Friday, it became clear that the rebels had taken at least 18 hostages in offices around the city.
Soldiers shot grenades through the barred window of a gift shop in the town centre, and security forces used an armoured personnel carrier to smash through the shop wall to save two hostages.
Three fighters were killed there, deputy prosecutor General Vladimir Kolesnikov said.
Four police officers, whom armed men had taken in a van in a getaway attempt, were rescued unharmed and the fighters were killed, Deputy Interior Minister Andrei Novikov said.
By midday, the head of the regional government, Gennady Gubin, announced that all resistance in the southern Russian city had been suppressed, all hostages freed and the city was being searched for armed men, the Interfax news agency reported.
Interfax reported later that 12 fighters had been killed in the office of the Russian prison administration, according to deputy administration chief Valery Krayev.
Other news agencies reported nine or 10 men had been killed there.
Relatives mourn a police officer
killed during the gun battles
Nine hostages were freed from the building earlier on Friday, Interfax said. Three police officers who had been held there were killed, the RIA-Novosti news agency said.
"It is bad that such bandit raids are still possible here," Putin said. "It's a great tragedy that we are sustaining losses among law enforcement officers and peaceful civilians."
The president of Kabardino-Balkaria, Arsen Kanokov, blamed the attack on social conditions, which fighters have capitalised on.
"The population's low income and unemployment create the soil for religious extremists and other destructive forces to conduct an ideological war against us," Kanokov was quoted by Interfax as saying.
The fighting comes amid a long-running regional campaign aimed at undermining separatist causes and what Russian officials name as Wahhabism, used to describe a strict practice of Islam.
Rights lawyers and the region's officially sanctioned Muslim leader say the campaign has caught up innocent, peaceful young Muslims, alienating and offending them as they rediscover their Muslim heritage.
Zarema Valgasova said her 26-year-old son, Daniil Khamukov, was a family man with two children - and an observant Muslim.
On Thursday morning, not long after gunfire began to reverberate around the city, he said goodbye to his family and set off for work as a window dresser.
By 11am, his battered, broken body was lying in the courtyard outside his home, bleeding from a compound arm fracture, Valgasova said. The body lay there for seven hours, she added; paramedics refused to help.
"They told us: 'They say he's one of the fighters. Let him die'," she said.
Russian special armed forces
storm a souvenir shop
At about 6pm, police collected Khamukov and took him to a precinct house. Valgasova said she knew nothing more about his fate.
Larisa Dolgova, a human rights lawyer who represents Muslims in their complaints about harassment and torture, said Khamukov was arrested because he was an observant Muslim who did not practise his belief through official channels, for example, by attending worship services at Nalchik's only authorised mosque.
At least 108 people, including 72 rebels, were killed in the fighting, according to a tally of accounts by officials, news reports and an AP reporter.
Twenty-four law enforcement officers were killed and 51 were wounded, Novikov said.
Amid conflicting casualty tolls, the regional department of the Emergency Situations Ministry said 18 civilians had been killed and 139 wounded, ministry duty officer Sergei Petrov said.
Other reports had put the number of civilian dead at 12.
Chechen separatists claimed involvement in the near-simultaneous attacks on police and security facilities that terrified the city of 235,000.
But Novikov said two-thirds of the men, mostly aged between 20 and 30, were local residents, the rest being from other Caucasus republics.
Thirty-one fighters were detained, RIA-Novosti quoted Nurgaliyev as saying.
Kabardino-Balkaria is near Chechnya, where separatists have been fighting Russian forces for most of the past decade.