The parliament in the restive Russian republic of Chechnya has come under attack with at least six dead.
Gunmen left at least two security personnel and one civilian worker dead when they attacked the building in the capital Grozny.
Reports suggest at least three attackers were killed, with two reportedly blowing themselves up.
Chechen President Ramzan Kadyrov is quoted as saying the operation is over and all militants have been killed.
Militants struck at around 0845 (0445 GMT), attacking policemen guarding the building, Mr Kadyrov told Russian news agency Interfax.
"As a result of co-ordinated actions, a special operation lasting 15-20 minutes was carried out to eliminate the militants and free the MPs and technical staff who were inside," he said.
He added that all the deputies inside the parliament were alive and safe, after being evacuated from parliament.
Russian news agencies say at least 10 people were injured in the violence.
The attack began at the start of the working day, as deputies were arriving at parliament, reports the BBC's Tom Esselmont in the Georgian capital Tbilisi.
Two of the attackers appear to have detonated explosives just outside the building, sparking an exchange of fire between remaining attackers and security guards.
Chechen police spokesman Ramzam Bekkhoyev told the Associated Press that attackers had run inside the building, shouting "Allahu Akbar" - Arabic for "God is great", before opening fire on people inside.
Reports at the time said hostages had been taken, but a spokesman for parliament later said they had been recovered.
The pro-rebel news website Kavkaz-Tsentr, quoted its own unnamed sources in Grozny as saying they had heard a "powerful" explosion, followed by heavy gunfire for more than 30 minutes.
The city has been sealed off and armoured vehicles were patrolling the streets, the pro-rebel website added.
Renewed violence
Russia's Interior Minister Rashid Nurgaliyev is visiting Chechnya and is thought to have held an emergency meeting with Mr Kadyrov, who is strongly backed by the Kremlin.
Mr Nurgaliyev later commended the Chechen security forces' response to the attack.
"The Chechen interior ministry acted professionally and competently," he said. "This meant that the operation was carried out successfully."
Mr Kadyrov is also reported to have briefed Russian Prime Minister Vladimir Putin on the phone.
This attack is highly reminiscent of those which peaked in the 1990s and then again some five or six years ago, our correspondent says, before Moscow declared victory in its battle with Chechen separatists.
Russia has since tried to wrest control of a seething Islamist insurgency in the last decade. Under the strongman President Kadyrov, there has relatively less violence - though it appears to have spilled over into neighbouring territories of North Ossetia and Ingushetia - but the unrest in Chechnya itself remains considerable.
This attack shows the battle is far from over, and Chechnya is far from being in the secure situation the Russian government would like to see, our correspondent says.