Mahmoud Ahmadinejad's eight years in power have isolated Iran internationally because of deep suspicions over its secretive nuclear programme and unwavering support for Syria's Bashar al-Assad, its closest regional ally, analysts say.
After two consecutive four-year terms since first taking office in 2005, Ahmadinejad is now constitutionally barred from standing in Friday's presidential election.
His disputed re-election in 2009 plunged Iran into domestic turmoil, as the regime used force to quell street protests. The suppression led only to increased international pressure on Tehran.
All-powerful supreme leader Ayatollah Ali Khamenei has the final say on all policy in the Islamic republic, including on its atomic ambitions and support for Assad's regime.
And most analysts agree that this left Ahmadinejad with no choice but to implement those policies.
"Iran's foreign policy is not the prerogative of the president," Ali Vaez, the Brussels-based International Crisis Group's senior analyst on Iran, told AFP.
But Shiite Iran is also paying the price for Ahmadinejad's fiery rhetoric, including his Holocaust denials and conspiracy theories about the September 11, 2001 terrorist attacks on the United States.
Tehran's friends in the region have dwindled as tensions mount with Sunni-ruled Arab monarchies over issues including pro-democracy protests in Bahrain and the Syria uprising.
"Ahmadinejad was unable to achieve foreign policy goals because of the way he carried out policies," Mohammad Saleh Sedghian, head of the Arabic Centre for Iranian Studies in Tehran, told AFP.
Already strained relations with the West have worsened, mostly over Tehran's defiant expansion of its nuclear programme against the backdrop of international demands and pressure to curb its activities.
Years of talks with world powers to defuse the nuclear stand-off -- which has led to a raft of Western economic sanctions coupled with others adopted by the United Nations Security Council -- have failed.
It is not clear how much Ahmadinejad is himself involved in the nuclear decision-making process, but he has repeatedly dismissed the international sanctions as "scrap paper".
Only in mid-2012 did he admit to economic "problems" caused by the sanctions.
Sedghian said Ahmadinejad's reliance "on slogans instead of clear-cut stances" to defuse tensions has only made things worse.
Signup to our newsletter and follow us on Facebook and Twitter!
He holds a record of eight appearances at the annual UN General Assembly during his tenure as president.
His speeches there have outraged the international community, and his Holocaust denial also revived enmities with Israel, whose existence Tehran does not recognise.
"Ahmadinejad got Iran into trouble. He could have not talked about the Holocaust -- it did not concern Iran," Sedghian said.
"His intervention had a negative effect on dealings with the world community."
Reformist analyst Mohammad Sadeq Javadihesar agreed, arguing that Ahmadinejad's public rants "only brought sanctions" for Iran.
"He lacks expertise in foreign policy and diplomacy," Javadihesar said of Ahmadinejad's conduct at home and abroad.
"His abilities were equivalent to those of a university graduate," he said, criticising Ahmadinejad's controversial decision to fire then foreign minister Manouchehr Mottaki while on an official visit to Senegal in 2010.
A major bone of contention between Tehran and Western and Arab countries, as well as Turkey, is Syria. The conflict has cost more than 94,000 lives since the civil war erupted in March 2011 after Assad cracked down on pro-democracy protests.
Tehran, a traditional ally of Damascus, is accused by Western and Arab governments of supplying weapons and military advisers to the Syrian regime.
It has repeatedly denied there are Iranian troops on the ground in Syria where Ahmadinejad has insisted that a rebel victory would threaten the entire region.
Analysts say that Ahmadinejad has no choice -- he had to support Assad.
"Ahmadinejad has merely been carrying out the regime's policy to consolidate the axis of resistance" against Israel, Sedghian said of the stance in Tehran, Damascus, and in the Lebanese Shiite movement Hezbollah towards the Jewish state.
Despite his record, Ahmadinejad has become a popular icon at home for his firebrand oratory.
It is a different story in the international arena, where he is seen as a pariah, except by some countries such as Venezuela.
"His rhetoric turned him into a radioactive statesman. From that point on, all Western politicians were loath to deal with him, independent of his intentions," Vaez said.
Most of the eight candidates vying to replace Ahmadinejad have identified mending ties with the world outside as a priority.
"Iran is left with fewer friends in the West and in the region," Sedghian said. "Ahmadinejad's foreign policy was not a strategic one, but a political show."