The meeting came hours before a Tehran-hosted summit between presidents of Iran, Russia and Azerbaijan to discuss trilateral and regional issues, including the Syrian crisis.
Russian President Putin on Wednesday described Iran as "a strategic partner" and a "great neighbor", stressing that Russia welcomes expansion of bilateral relations.
Moscow said Syria will be a focus of Putin's visit, which comes after Russia, Iran and Turkey pledged after negotiations in Kazakhstan yesterday to bring the Syrian regime and its opponents together for a "congress" to push peace efforts. Our cooperation can isolate the United States.
Moscow is also an important ally for Iran in its renewed confrontation with the United States, where Trump broke ranks with major allies on October 13 by de-certifying Tehran's nuclear deal with six world powers including Washington under his predecessor Barack Obama.
Putin and the Iranian leadership are also set to find common cause in their fierce opposition to Trump's stance on the 2015 deal to curb Iran's nuclear ambitions.More news: SA now the front-runner to host Rugby World Cup 2023
More news: Media is 'obsessed' with Russian Federation probe, but Americans don't care: White House
More news: Three arrested in shooting after speech by white nationalist Richard Spencer
The Russian commander, for his part, voiced satisfaction over the current level of defense and military cooperation between Iran and Russia. After the meeting the three Presidents will issue a joint statement.
"We oppose any unilateral change in the multilateral nuclear deal", Putin told Khamenei, Iranian state TV reported.
The Iranian, Russian, and Azerbaijani leaders also agreed on November 1 to increase cooperation in the oil and gas industry, including in production as well as oil and oil-products swaps, the statement said.
Russian Federation has criticized Trump's disavowal of the nuclear agreement, which has opened a 60-day window for the U.S. Congress to act to reimpose economic sanctions on Iran.
Putin was in Tehran to take part in the second three-way summit with Rouhani and Azeri President Ilham Aliyev.