Special forces officers killed two men and detained one more outside Moscow on suspicion that they were plotting a terror attack in the city, the National Anti-Terrorism Committee said.
The officers came under fire when they surrounded a house with the suspects on Monday in the city of Orekhovo-Zuyevo, roughly 80 kilometers from Moscow, and demanded that they surrender.
In the ensuing firefight, the officers shot and killed two of the suspects, and captured another, the committee said.
One special forces officer suffered a light wound. There were no civilian casualties.
"The decisive actions of law enforcement agencies foiled an effort to commit a terror attack in the capital," the committee said in a statement late Monday.
The suspects are Russian citizens who returned from Afghanistan or Pakistan, where they received battle training and prepared to carry out terror attacks, the statement said.
The Federal Security Service briefed President Vladimir Putin about the operation and kept him updated about its progress, his spokesman Dmitry Peskov said, Interfax reported.
A law enforcement source told the news agency that the men were planning to strike a large-scale public gathering in Moscow. Security officers acted on intelligence data, the source added.
Another law enforcement source told Interfax that the men had lived in Pakistan and practiced Islam.
Security officers had kept them under surveillance for a month.
Intelligence showed that the men, whose names weren't released, underwent training in Northern Waziristan, a mountainous patch of land in Pakistan, the source said.
It hasn't yet been established to which extremist group the suspects belonged, the source said.
Security officers are now checking whether the suspected terrorists were affiliated with the militant Islamic Movement of Uzbekistan and whether they had contacts in the Moscow region.
Waziristan is a region that security services have called a stronghold of the Taliban.
According to the source, the area is home to training camps for would-be terrorists from around the world.