Twenty anti-government gunmen who were holed up in an Armenian police station for two weeks surrendered on Sunday, security services said, ending a tense stand-off that left two police officers dead and triggered mass protests.
The armed men gave themselves up a day after police warned they would storm the building to draw a line under the crisis, which had sparked at times violent demonstrations by opposition supporters in the capital Yerevan.
"The security forces' anti-terrorist operation has ended and led to the members of the armed group laying down their weapons and surrendering to the authorities," the national security service said in a statement.
"Twenty terrorists were arrested," it said.
"The territory of the police station has been liberated."
During the fortnight-long drama the armed men also took hostages, freeing the final two, both medics, late Saturday.
They said they were demanding the release of jailed opposition leader Zhirair Sefilyan and the resignation of President Serzh Sarkisian, a former communist party leader who came to power in 2008.
An Armenian website had earlier Sunday published what it said was a statement from one of the gunmen inside the police station, saying they were ready to surrender.
"We will continue our struggle from prison. We believe that we have achieved our goal: we became the spark that allowed people to rise up and it makes no sense to spill blood," Varuzhan Avetisyan was quoted as saying.
He also said that overnight security forces had "40 shooters lying in wait" for the assault to take back the station and if his group had resisted it would have led to "a bloodbath".
- Thousands join protests -
The gunmen plunged Armenia into turmoil when they stormed the police station in Yerevan on July 17, killing an officer and taking several others hostage.
They let the officers go but then seized four medical workers before gradually freeing them too.
On Saturday a second officer was killed by a sniper who authorities said was firing from inside the seized police compound, a claim denied by the gunmen.
The crisis also brought thousands of pro-opposition demonstrators to the streets, calling for President Sarkisian to step down.
Violence erupted at a rally on Friday, when police used truncheons, stun grenades and smoke bombs to disperse the crowds. More than 70 people were injured, including journalists, and dozens were arrested.
The United States and the European Union both voiced concern over the unrest.
Despite the violence, several thousand protesters again gathered on the streets of Yerevan late Sunday demanding that the president resign, and chanting the name of the armed group, which calls itself "Sasna Tsrer", and that of its leader, known as Pavlik.
Sasna Tsrer brings together supporters of Sefilian, a fierce government critic who was arrested with six supporters in June accused of preparing to seize government buildings and telecoms facilities.
The hostage crisis and violence has shaken the small landlocked ex-Soviet nation, just months after a surge in the conflict with Azerbaijan over separatist ethnic-Armenian region of Nagorny-Karabakh left 110 people dead in April.