In early 2024, the president of a university in Budapest received a surprising call from a senior Hungarian official, asking him for an unexpected favor.

These developments come within the framework of a long-standing intelligence conflict between Israel and Iran.

The official told the university president, Professor Gergely Deli, that the Ludovika University of Public Service should hold a conference on climate change, and extend an invitation to an unexpected figure: Mahmoud Ahmadinejad, the controversial former Iranian president.

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 operatives, his declared enemy.

Deli was aware that this invitation could damage both his reputation and the university's. 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 best to do what you can to make them talk.'

According to American and Iranian officials familiar with the operation, who spoke on condition of anonymity due to the sensitivity of intelligence information, Ahmadinejad's visit to the university in 2024, and his 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 a new leader of Iran.

Former American 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 thereafter informed the U.S. Central Intelligence Agency (CIA) that it had been in contact with Ahmadinejad.

Photo published by the website 'Dolat-e Bahar' of the former president Mahmoud Ahmadinejad's office showing him participating in the funeral procession of former Supreme Leader Ali Khamenei in Tehran on Monday

Israel's decision to build a plan for regime change in Tehran focusing on Ahmadinejad marks a striking shift in its relationship with the former Iranian president, known for accelerating the nuclear program, calls for the destruction of Israel, and denial of the Holocaust.

According to American officials, Israel in recent years secretly paid Ahmadinejad to cover housing and travel expenses, and Israeli operatives 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 American-Israeli war on Iran, in a daring operation to relocate the former leader, who was living 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 the Ahmadinejad compound, targeting the building housing his bodyguards and his armored vehicle. After the strike, according to four senior Iranian officials, a black Peugeot car arrived, carried Ahmadinejad, and sped away from the chaotic site.

American and Iranian officials familiar with the operation said the car was driven by Mossad operatives, who transported Ahmadinejad to a secret safe house inside Iran.

But the former Iranian president was upset by the frantic rescue operation and appeared disillusioned with the Israeli plan to return him to power, according to people familiar with the matter.

He later left the safe house under unclear circumstances. Ahmadinejad did not reappear in public 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 communications with Israel.

Israeli officials have not publicly commented on the plan to install Ahmadinejad as leader of Iran, which was part of a broader attempt to overthrow the government in Tehran. Another element of the plan involved arming and training Kurdish Iranian 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.

Former head of Israeli military intelligence, Tamir Hayman, said during the PBS program 'Firing Line' 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.

Shift after presidency

As president of Iran from 2005 to 2013, Ahmadinejad was one of the country's most hardline politicians. He called for the annihilation of Israel, and during his tenure Iran resumed uranium enrichment, raising suspicions that it was pursuing a secret nuclear weapons program. He also ordered a violent crackdown on the nationwide uprising protesting his 2009 re-election, and his tenure saw the judiciary carry out mass executions of dissidents and imprison opponents and rivals.

Ahmadinejad waves his hands as he arrives at the Interior Ministry's candidate registration commission for the presidential election in June 2024 (Archive - EPA)

But in the years after leaving the presidency, Ahmadinejad softened his positions and moderated the anti-Israel rhetoric that characterized his rule. He was keen to project his new, more moderate image by giving interviews and speeches in which he discussed Iranian pop music culture, criticized security forces for violent crackdowns, and accused the ruling class of financial corruption.

He also abandoned his loose khaki jacket, his trademark, and began wearing tailored suits. He tended to 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 listen to the complaints of ordinary citizens, some of whom sought his help dealing with government bureaucracy. Sometimes he wrote letters to ministries recommending granting loans to certain applicants. He also regularly traveled across the country, meeting supporters in cities and rural areas.

Ahmadinejad speaks 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 (Archive - ILNA)

Ahmadinejad's relationship with the Iranian government was complex. Senior leaders marginalized him and imposed restrictions on his movements, but 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.