In early 2024, the president of a university in Budapest, Hungary, received a surprise request from a senior Hungarian government official.

The official told the university president, Professor Gergely Deli, that the Ludovika University of Public Service should organize a conference on climate change and invite an unexpected guest: Mahmoud Ahmadinejad, the former Iranian president who is widely reviled.

The reason was even more surprising. The official told Deli that the conference was merely a cover to allow Ahmadinejad to hold secret talks in Budapest with Israeli intelligence agents, his declared enemy.

Deli was aware that the invitation could harm both his reputation and that of the university. But he said in an interview that he thought he might play a role in saving lives.

He said: 'You have two enemies, and if these two enemies want to talk to each other, it's better to do what you can to make them talk.'

According to US and Iranian officials briefed on the operation, who spoke on condition of anonymity due to the sensitivity of intelligence information, Ahmadinejad's visit to the university in 2024, followed by a second visit the following year, were part of a years-long Israeli effort to groom him as an intelligence asset who could, when the time came, be installed as Iran's new leader.

Former US officials said that recruiting Ahmadinejad was such a high priority for Israel that the then-head of Israeli intelligence, David Barnea, traveled to the Hungarian capital in 2024 to meet Ahmadinejad. They added that the Mossad, Israel's foreign intelligence agency, shortly afterward informed the US Central Intelligence Agency (CIA) that it had been in contact with Ahmadinejad.

Image published by 'Dolat-e Bahar' website, the spokesperson for the office of former president Mahmoud Ahmadinejad, showing his participation in the funeral of former Supreme Leader Ali Khamenei in Tehran on Monday.

Israel's decision to build a regime-change plan centered on Ahmadinejad marks an extraordinary shift in its relationship with the former Iranian president, who was known for accelerating Iran's nuclear program, repeatedly calling for the destruction of Israel, and denying the Holocaust.

According to US officials, Israel in recent years secretly paid Ahmadinejad for housing and travel expenses, and Israeli agents met with him abroad on several occasions, including during his trips to Budapest.

This effort culminated in late February of this year, during the early days of the US-Israeli war on Iran, with a bold operation to move the former leader, who was under tight surveillance in Tehran. The goal was to launch the plan to overthrow the current regime and install Ahmadinejad. But the plan failed.

On February 28, an Israeli airstrike hit Ahmadinejad's compound, targeting his bodyguards' building and his armored vehicle. After the strike, according to four senior Iranian officials, a black Peugeot arrived, picked up Ahmadinejad, and sped away from the chaotic scene.

US and Iranian officials briefed on the operation said the car was driven by Mossad agents, who moved Ahmadinejad to a secret safe house inside Iran.

However, the former Iranian president was unhappy with the frantic rescue operation and appeared disappointed with the Israeli plan to return him to power, according to people familiar with what happened.

He later left the safe house under unclear circumstances. Ahmadinejad did not appear in public again until July 6, when he briefly participated in the funeral procession of the late Iranian Supreme Leader Ali Khamenei.

His current status remains uncertain. But four senior Iranian officials said Ahmadinejad is being held by the intelligence arm of the Revolutionary Guard and is currently under house arrest after Iran learned many details of his communication with Israel.

Israeli officials have not publicly commented on the plan to install Ahmadinejad as Iran's leader, which was part of a broader attempt to overthrow the government in Tehran. Another element of the plan involved arming and training Iranian Kurdish opposition forces based in northern Iraq to cross the border into western Iran, seize territory there, and eventually advance toward Tehran — a plan that never materialized.

Tamir Hayman, former head of Israeli military intelligence, said on PBS's 'Firing Line' program in May, after the New York Times first revealed details of Ahmadinejad's role in the plan: 'The regime-change plan included a series of very, very unique special operations that were supposed to be executed.' He added, 'And Ahmadinejad was part of that series.'

Mossad officials did not respond to requests for comment. Ali Akbar Javanfekr, Ahmadinejad's spokesman, also declined to comment.

Post-Presidency Transformation

As president of Iran from 2005 to 2013, Ahmadinejad was the country's most prominent hardline politician. He called for the elimination of Israel, and under his tenure Iran resumed its uranium enrichment program, raising suspicions that it was pursuing a secret nuclear weapons program. He also ordered a violent crackdown on the nationwide uprising protesting his 2009 reelection, and his era saw the judiciary carry out mass executions of opponents and jail rivals and competitors.

Ahmadinejad waving as he arrives at the headquarters of the presidential elections registration committee at the Interior Ministry in June 2024 (File photo - EPA)

But in the years after leaving office, Ahmadinejad softened his positions and toned down the anti-Israel rhetoric that marked his tenure. He was eager to project a new, more moderate image by giving interviews and speeches where he discussed Iranian pop music culture, criticized security forces for violent crackdowns, and accused the ruling class of financial corruption.

He also abandoned his trademark loose khaki jacket and began wearing tailored suits. He groomed his unkempt beard, appeared to have undergone Botox treatment, and started learning English.

In his Tehran office, he held daily hour-long public meetings to hear complaints from ordinary citizens, some of whom sought his help dealing with government bureaucracy. Sometimes he wrote letters to ministries recommending loans for certain applicants. He also traveled regularly across the country, meeting supporters in cities and rural areas.

Ahmadinejad speaking with his ally Saeed Jalili, advisor to the Iranian Supreme Leader, on the sidelines of the opening ceremony of the Assembly of Experts in Tehran (File photo - ILNA)

Ahmadinejad's relationship with the Iranian government was complex. Senior leaders marginalized him and imposed restrictions on his movements, but they allowed him to sit alongside other senior officials on a high-level council that advises the Iranian Supreme Leader. He attended a meeting of that council in February, just days before the war broke out.