The Russian threat, hours after the latest negotiating round ended, appeared to catch Washington off guard.
Days ahead of the meeting, U.S. State Department spokeswoman Jennifer Psaki had said she expects Russia to "remain an active partner" in the talks. During the two-day talks, Western officials involved described Russia's participation as constructive and unchanged by the Ukraine tensions.
Ryabkov was cited by the Interfax news agency as saying Russia may feel compelled to respond to U.S. and European Union actions. He said Russia considers "reunification" with Crimea more important than the developments surrounding Iran's nuclear program.
"We wouldn't like to use these talks as an element of the game of raising the stakes taking into account the sentiments in some European capitals, Brussels and Washington," Ryabkov was quoted as saying. "But if they force us into that, we will take retaliatory measures here as well."
Russia and the U.S. often hold different positions about what Iran needs to do to banish fears about its nuclear activities. That includes uranium enrichment, which Iran says it needs to make reactor fuel but which can also manufacture fissile warhead material.
Ahead of the most recent talks, diplomats told The Associated Press that Moscow was ready to accept a more robust Iranian enrichment program than Washington.
But American officials have always said that Russia and the United States are united in their goal of banishing the threat of a nuclear-armed Iran, even if they differ on how to get there.
Iran has often tried to exploit U.S.-Russian differences and Ryabkov's comments could embolden it to resist significant nuclear cutbacks.
China usually supports Russia at the negotiations but the United States, Britain, France and Germany are unlikely to accept a lenient deal.
At worst, the talks could fall apart. That could embolden Israel to make good on threats to attack Iran's nuclear facilities and draw the United States into any military confrontation.
The Russian comments overshadowed signs that Iran may be ready to compromise.
Iranian Foreign Minister Mohammad Javad Zarif had suggested earlier Wednesday his country was ready eliminate fears that a reactor it is building at Arak could be used to make atomic arms.
Zarif implied that Iran was open to re-engineering the facility to one that would produce less plutonium, according to the semi-official Fars news agency. Like enriched uranium, plutonium can be used to arm nuclear warheads.
While Iran insists on completing and running its nuclear reactor, "any proliferation concerns" linked to it "have to be removed," he was quoted as saying.
Ischachenkov reported from Moscow. Margaret Childs in Vienna and Associated Press writer Ali Akbar Dareini in Tehran contributed to this report.