By Steve Rosenberg
BBC News, Nalchik
President Putin has warned there will be a severe response in the event of any future action like Thursday's raid by rebels on the southern Russian city of Nalchik. It lies in the North Caucasus republic of Kabardino-Balkaria, which has seen an increasing level of violence in recent months. Steve Rosenberg says attempts by the authorities to clamp down on radical Islamist groups have backfired.
Russian forces hunt down those who carried out recent attacks in Nalchik
I was nervous about travelling to Nalchik.
Before our trip we had spoken to journalists who had visited Kabardino-Balkaria in the past.
The picture they had painted was of a corrupt, neo-Stalinist regime which hated only one thing more than dissent - and that was the media.
I had been told stories of reporters being trailed by the secret services; of video tapes disappearing from hotel rooms; and of official thugs beating up locals who dared to help foreign journalists get their story.
To ensure that none of this happened while we were there, we decided to ask the Kremlin to help arrange our trip.
At least that way, I thought, local officials in Kabardino-Balkaria might think twice before trying to cause us problems.
But the problems began as soon as we got off the plane in Nalchik.
At baggage reclaim we were interrogated by plain clothes officers.
One of the men raised his eyebrows when he saw our video camera
Who were we? Why had we come here? Who were we going to meet?
I flashed my foreign journalist accreditation card but the questions kept coming.
Which hotel were we in? When were we going to leave?
One of the men raised his eyebrows when he saw our video camera.
"How did you manage to sneak that thing onto the plane?" he asked.
They knew very well where we were staying. We had been assigned rooms in a government hotel. A local official met us outside the airport and drove us into the city centre.
Nalchik was once a resort town - gateway to Europe's highest peak, Elbrus, and to some of the Soviet Union's plushest ski resorts.
Today the city is in decay. The rusting funicular suspended over the city a reminder of the days when tourists flooded here from across the USSR.
But the conflict in Chechnya, just 50 miles east, had destroyed the local tourist industry. And the violence had already begun spilling over into Kabardino-Balkaria.
Our official guide took us to see a block of flats - recently repaired.
Earlier this year Islamic militants had barricaded themselves inside and there had been a ferocious gun battle with security forces.
All the insurgents had been killed.
There had been a similar incident in another part of town and the local authorities were clearly bracing themselves for further violence.
Troops in training
We were driven to a sports field on the edge of Nalchik to meet the Kabardino-Balkaria anti-terrorism squad. They were training to repel a rebel attack.
In pairs the troops showed us how to disarm a gunman coming at you with a Kalashnikov - the demonstration was hardly impressive - they kept getting it wrong.
What the authorities did not seem to realise then was that radical ideas cannot simply be shut down or locked away
In the end their frustrated commander took them aside and forced the soldiers to practice 20 times before reappearing with the new, improved show and allowing us to switch our camera back on.
But who were the Islamic militants the authorities so feared?
To find out we drove into the mountains to Kendelen - a village which, like so many parts of Kabardino-Balkaria, is poverty stricken.
Unemployment here is running at more than 90%.
This is where one of the gunmen killed in the apartment block shoot-out had come from.
Muslim Atayev was head of an Islamic group called Yarmuk - the same organisation which has been linked to Thursday's most recent attacks in Nalchik.
It is based in Kabardino-Balkaria, but it has links to the Chechen rebels. Muslim's wife Sakinat and their baby daughter died with him in the gun battle.
In Kendelen we spoke to Sakinat's father, Zelimkhan.
Clutching a photograph of his daughter, he told me he could understand why people in Kabardino-Balkaria were attracted by radical religion.
"It is poverty," Zelimkhan told me, "that pushes people into the hands of extremists."
But there is another reason.
On the edge of the village we met a young man called Elbrus.
He claimed that thousands of young Muslims in Kabardino-Balkaria were being radicalised by the heavy-handedness of the police and the authorities.
"If people's patience snaps", Elbrus warned, "there will be violence."
We returned to Nalchik in time for Friday prayers.
To try to curb the spread of radical religion, the local authorities had closed down six out of the city's seven mosques.
But the policy was not working. We found a group of more than 100 Muslims praying on the street.
Among them was a teacher called Zelim. He told me that he and his students had been detained recently by police for studying the Koran.
"The police asked my students", Zelim said, "if I had taught them to make bombs or suicide belts.
"They beat me, then they told me to stop preaching and to stop talking about my religion."
What the authorities did not seem to realise then was that radical ideas cannot simply be shut down or locked away.
Under pressure they thrive and spread.
During the past few days Kabardino-Balkaria has seen the consequences.
From Our Own Correspondent was broadcast on Saturday, 15 October, 2005 on BBC World Service. Please check the programme schedules for World Service transmission times.