The FSB said the suspects, both from Central Asia, were killed in a shootout when they resisted arrest in a home in the Vladimir region east of Moscow.
They were in contact with recruiters from international terror organizations, had shown an interest in making bombs and expressed a readiness to carry out attacks in Russia, it said in a statement.
The agency has appeared eager to demonstrate its ability to prevent attacks following this month's suicide bombing on the St. Petersburg subway that killed 14 passengers.
The bomber was from Kyrgyzstan, one of the impoverished former Soviet republics in Central Asia that are seen as fertile ground for extremists.
The FSB didn't identify the suspects killed, saying only that they were citizens of one of the Central Asian countries.
An FSB video broadcast on state television showed the bodies of the two men, one with a Kalashnikov automatic rifle lying next to him. The video also showed a collection of what were described as components for making explosives.
FSB director Alexander Bortnikov last week announced that his agency had prevented 16 terror attacks in nine Russian cities in 2016, many of them involving migrant workers from other parts of the former Soviet Union.