Former Iranian President Mahmoud Ahmadinejad has come out in support of Ukraine as it fends off an invasion from Russia, a stark contrast to the pro-Moscow bent of the current regime in Tehran.

"The great nation of #Ukraine President #Zelenskyy. Your honorable and almost unrivalled resistance uncovered the Satanic plots of enemies of mankind. Trust that the great nation of  #Iran is standing by you, while admiring this heroic persistence," he tweeted.

AGREEMENT TO RESTORE IRAN NUCLEAR DEAL EXPECTED WITHIN DAYS: EUROPEAN DIPLOMAT

Ahmadinejad, who was president of the Islamic Republic between 2005 and 2013, is one of a number of top current and former officials across the world to come out in support of Ukraine and Zelenskyy as the international community rallies around the Eastern European country in the face of the Russian invasion.

However, the Iran regime itself is an ally of Russia and has sought to disperse blame for the invasion.

Supreme Leader Ali Khamenei in a recent speech blamed the crisis on the United States.

"Today, Ukraine is a victim of the U.S. crisis-making policy because it was the United States that brought Ukraine to this point by interfering in Ukraine's internal affairs, organizing rallies and creating a velvet and colorful coup, the presence of American senators in opposition rallies, and the replacement of governments has brought this country to this point," Khamenei said, according to the Iranian government.

The dictator also described the U.S. as a "mafia regime" in his speech.

IRAN NEARING NUCLEAR THRESHOLD, WITH US OPTIONS TO STOP IT NARROWING, REPORT WARNS 

Iranian Foreign Minister Hossein Amirabdollahian said last week that the Ukraine crisis "is rooted in NATO's provocations."

"We don't believe that resorting to war is a solution," Amirabdollahian tweeted. "Imperative to establish ceasefire & to find a political and democratic resolution."

Meanwhile, the U.S., Russia and Iran are all part of the ongoing talks in Vienna to bring Iran back into compliance with the 2015 Iran nuclear deal.

CLICK HERE TO GET THE FOX NEWS APP

A European diplomat told Fox News Friday that a deal is expected within days. But with Russia’s involvement in the deal, it raises the possibility of financial benefit for Moscow in a new deal, like payments to take Iranian uranium. 

The diplomat told Fox that the West will find a way to enable the deal and says the concerns are "nothing that can’t be overcome."

Fox News’ Rich Edson contributed to this report.