WASHINGTON — As the U.S. presses for a deal to limit Iran's nuclear program, it is getting help from an unlikely ally: Russia.

Relations between the two countries have tumbled to a low point this year because of a dispute over Moscow's decision to grant temporary asylum to former National Security Agency contractor and leaker Edward Snowden and long-standing friction between President Obama and Russian President Vladimir Putin. Analysts say neither side views repairing the overall relationship as a top priority.

Yet they have been careful to build cooperation in areas vital to them. They are working closely on the effort to rid Syria of its chemical weapons. And on Iran, an issue of even greater importance to the White House, they are quietly collaborating.

Despite Moscow's good relations with Tehran and its fervent dislike of international sanctions as a policy tool, it has provided crucial support to the effort to curb Iran's nuclear ambitions. Russia worries that failure to strike a deal would lead to military action against Iran, which would destabilize a vast stretch of territory along the southern Russia frontier and roil the markets for its oil and natural gas, on which Russia's economy depends.

"There are tactical differences," said Gary Samore, a former member of Obama's inner circle of Iran advisors, who is now research director at the Belfer Center at Harvard's Kennedy School of Government. "But at the end of the day, the United States and Russia have common interests."

The Obama administration sees the election this summer of the moderate Hassan Rouhani as Iran's president as an opportunity to make progress. The Iranian economy has been hit hard by sanctions imposed over its nuclear program, and its leaders are eager to see them lifted. The diplomatic stalemate between the U.S. and Iran, which has lasted more than 30 years, lifted enough in late September for Obama and Rouhani to talk by telephone.

Moscow appears to be pressing even harder than Washington for a deal. At the end of two days of talks last week in Geneva between the Iranians and diplomats representing six world powers, the two sides praised the positive atmosphere. But for Russia's chief negotiator, the glass was half empty.

The distance between the sides "can be measured in kilometers," said Deputy Foreign Minister Sergei Ryabkov. "There is no reason to break into applause."

Although Iran has been an ally on Syria and a buyer of Russian arms and nuclear equipment, Moscow doesn't want it to have a bomb.

"There is a clear understanding in the Kremlin that should Iran get in possession of nuclear arms, it would turn into a source of instability, not only for the region, but for the former Soviet countries bordering on Russia in the south," said Alexander Umnov, a Middle East specialist at the Institute of World Economy and International Relations in Moscow.

Russia's support for the so-called P5-plus-1 diplomacy, the U.S.-led effort to negotiate with Iran, has been key to the effort for a number of years.

With China following Russia's lead on the issue, Moscow's cooperation has allowed Western diplomats to claim that world powers are united in wanting to restrain an effort many fear is aimed at acquiring nuclear weapons capability.

Paul Saunders, a former State Department official now at the Center for the National Interest in Washington, said Russian-Iranian relations were "cooperative but not close."

He said Russia appreciated that Iran had not sought to export instability into Central Asia, which Moscow considers an especially sensitive region. Russia sells arms to Iran, has cultural exchanges with it and has stepped up cooperation in fighting drugs. Yet there is also "mutual frustration and mistrust," Saunders said. Moscow was not happy when it was disclosed in 2009 that Iran had secretly been enriching uranium in a new underground facility.

Iran and Russia are engaged in international arbitration over Russia's decision to cancel the 2007 sale of five advanced S-300 anti-missile systems. And though Russia has sold arms and nuclear equipment to Iran, the exports are limited, no larger than what it sells Singapore, for example, Saunders said

Russia appears less eager than the United States or its European allies to restrict Iran's nuclear activities, other than development of a weapon. But U.S. and private experts say there is no indication that Moscow is preparing to split from the group.

Two days after Ryabkov complained of the lack of progress at the Geneva talks, a spokesman for the Russian Foreign Ministry reversed direction, praising what he called progress.

The U.S.-Russia cooperation on Iran seems all the more remarkable in light of the gaping differences in the rest of their relationship.

The countries are at odds over strategic arms control, missile defense, human rights in Russia and Moscow's effort to extend its influence in neighboring states.

Obama canceled a visit to Moscow in September. A top aide to Putin, Yuri Ushakov, said this week that the two would meet no sooner than early next year.