Russia's security state has been ruthlessly effective at detaining Russian President Vladimir Putin's opponents but was caught off guard by a mass shooting near Moscow, raising questions about its priorities, resources and intelligence gathering.

Charged with hunting down Ukrainian saboteurs inside Russia, with keeping anti-Kremlin activists in check, and with disrupting the operations of hostile foreign intelligence agencies, the FSB, the main successor agency to the Soviet-era KGB, has its hands full.

That, say former U.S. intelligence officials and Western security analysts, helps explain why it may have overlooked other threats, including that posed by Islamist militants, such as ISIS-K, which claimed responsibility for the attack.