- The comments came after Ahmadinejad's candidacy was rejected by Iran's Guardian Council, the vetting body of supreme leader Ayatollah Ali Khamenei.
- Iran's economy and vital oil exports have been crippled by the double blow of Covid-19 and sanctions from the U.S. and other world powers.
As Iran prepares to head to the polls on Friday, the country's hardline former president has called out the U.S. for meddling in the Middle East.
In a wide ranging interview with CNBC ahead of the vote, Mahmoud Ahmadinejad said the 2015 nuclear deal caused "more problems than it resolved" and cast doubt on the legitimacy of his country's election.
"Any decision that prevents the people from influencing the outcome is against the spirit of the revolution and the constitution," Iran's former president told CNBC.
The comments came after Ahmadinejad's candidacy was rejected by Iran's Guardian Council, the vetting body of supreme leader Ayatollah Ali Khamenei. The move essentially barred him from running in the 2021 election.
"I made it clear on the day that I announced my candidacy that I will not participate in the elections if the will of millions of people is denied for no legitimate reason, like it has been in the past," Ahmadinejad said about the decision to exclude him.
A field of more than 600 candidates was narrowed to just five on Thursday. The presidential race is now seen as a contest between the moderate former central bank chief, Abdolnasser Hemmati, and the hardline judiciary chief, Ebrahim Raisi.
Analysts say Raisi is the clear frontrunner, with the highest name recognition among the candidates. Raisi served four decades in Iran's judiciary and ran but lost to moderate President Hassan Rouhani in the 2017 election.
Ahmadinejad's two terms between 2005 and 2013 were marked by fiery exchanges, with him lashing out repeatedly against U.S. policy and Israel and pursuing Iran's nuclear ambitions.
The former leader told CNBC that any change in leadership will have implications for already-strained relations between the United States and Iran, which are negotiating to free a crippled Iranian economy from sanctions in exchange for new limits on its nuclear program.
"The JCPOA caused more problems than it resolved," Ahmadinejad said when asked about the deal that former U.S President Donald Trump abandoned in 2018, known as the Joint Comprehensive Plan of Action.
Originally signed between Iran and world powers in 2015, the JCPOA put restrictions on Iran's nuclear program in exchange for sanctions relief.
The former president said he believed a new nuclear deal with the United States was possible, but the timeline on an agreement was still uncertain given the apparent differences on both sides.
"I believe that the two countries will need to change their perspectives and look at each other differently," Ahmadinejad said. "If we base things in accordance with justice and mutual respect, then I believe that the problems can be solved."
Raisi has voiced support for Iran's nuclear talks in the past, but it's unclear how a change in leadership in Iran will impact the negotiations.
"While in theory it would be possible to conclude the talks and get everything signed before Rouhani steps down, past experience shows that the nuclear talks tend to move at a snail's pace, even without political complications," Raymond James analyst Pavel Molchanov said.
"We doubt that Raisi will be as belligerent and strident as Ahmadinejad had been, but they are closer ideologically to each other as compared to Rouhani," he added. "Depending on what Raisi says after the election, and how his administration behaves in its early days, it is even possible to envision a suspension of the talks altogether, though that would be a rather extreme scenario."
Relations between Iran and its Gulf Arab neighbors have begun to thaw since the election of U.S. President Joe Biden, but Ahmadinejad said U.S. "meddling" via arms sales remains a challenge to regional stability.
"When tens of billions of dollars of arms is sold to countries within the region annually, this causes major problems," he said. "This threatens the security of the region and is considered as meddling. … The U.S. government should not be seeking to control Iran, or the Middle East."
The U.S. is the world's largest arms supplier and the Middle East is a key export market, according to the Stockholm International Peace Research Institute. The U.S approved the sale of $23 billion in arms to the United Arab Emirates earlier this year. Weapons sales to Saudi Arabia, a key Iranian rival, are under review.
Iran's economy and vital oil exports have been crippled by the double blow of Covid-19 and sanctions from the U.S. and other world powers. So far, over 3 million people in the country have tested positive for the coronavirus, according to data compiled by Johns Hopkins University, and over 82,000 people have died.
"Iranian people believe that the response to the Covid pandemic in the country was a failure," Ahmadinejad said. "I must say that the front-line workers and the medical professionals worked tirelessly, but the overall management has been ineffective and unwise," he added.
Iran's financial hit from Covid-19 was less pronounced than in other countries because its economy had already contracted by 12% over the previous two years.
A new nuclear deal and sanctions relief would allow fresh revenues to flow early in a new government's term. Iran's real gross domestic product is estimated to grow by 1.7% in 2020-2021, according to the World Bank.
Iranian officials say oil production could reach 4 million barrels per day within 90 days of sanctions being lifted. As it stands, Iran's oil exports are minimal, as Trump-era sanctions continue to dissuade most international buyers.
—CNBC's Emma Graham contributed to this article.