In early 2024, the president of a university in Budapest, Hungary, received an unexpected call from a high-ranking Hungarian government official with an ambiguous request.

This incident reveals the unusual complexities of international intelligence games, where contradictory interests converge in a single location.

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

Most surprisingly, the reason was that the official told Deli the conference was merely a facade 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 that of the university. However, in an interview, he stated he believed he might be playing a role in saving lives.

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

According to U.S. and Iranian officials familiar with the operation, who spoke on the condition of anonymity due to the sensitivity of the intelligence, 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 into an intelligence asset who could, when the moment arrived, be installed as the new leader of Iran.

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

A photo published by the "Dolat-e-Bahar" website, which speaks for former President Mahmoud Ahmadinejad's office, shows him participating in the funeral of the late Supreme Leader Ali Khamenei in Tehran on Monday.

Israel's decision to build a regime-change plan centered on Ahmadinejad represents an extraordinary turn in the trajectory of its relationship with him, as he was the one who accelerated Iran's nuclear program, called for the destruction of Israel, and denied the Holocaust.

According to U.S. officials, Israel has secretly paid Ahmadinejad money in recent years to cover his housing and travel expenses, and Israeli operatives have 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 U.S.-Israeli war on Iran, through a daring operation to extract the former leader, who was living under tight surveillance in Tehran. The goal was to launch the plan aimed at toppling the current regime and installing Ahmadinejad. But the plan failed.

On February 28, an Israeli airstrike hit Ahmadinejad's compound, targeting the building housing his bodyguards 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.

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

However, the former Iranian president was disgruntled by the frantic rescue operation and appeared disappointed by the Israeli plan to return him to power, according to individuals with knowledge of what transpired.

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

His current status remains uncertain. However, four senior Iranian officials said that Ahmadinejad is being held by the intelligence arm of the Islamic Revolutionary Guard Corps and is currently under house arrest after Iran learned many details of his contact 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 topple 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, the former head of Israeli Military Intelligence, said during the "Firing Line" program broadcast by PBS in May, after The New York Times first revealed details of Ahmadinejad's role in the plan: "The regime change plan involved a series of special, very, very unique operations that were supposed to be carried out." He added, "And Ahmadinejad was part of that series."

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

Transformation After the Presidency: As president of Iran between 2005 and 2013, Ahmadinejad was the country's most prominent hardliner. He called for the elimination of Israel, and under his tenure, Iran resumed its uranium enrichment program, raising suspicions that it was pursuing a covert nuclear weapons program. He also ordered a violent crackdown on the nationwide uprising that erupted to protest his 2009 reelection, and his era witnessed the judiciary carrying out mass executions of dissidents and the imprisonment of opponents and rivals.

Ahmadinejad waves his hands upon arriving at the presidential candidate registration center at the Ministry of Interior in June 2024 (Archive - EPA).

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

He also abandoned his loose, khaki-colored jacket, which was his trademark, and began wearing tailored suits. He groomed his messy beard, appeared to have undergone Botox treatment, and began learning English.

In his office in Tehran, he held one-hour public meetings every morning to listen to the complaints of ordinary citizens, some of whom sought his help in dealing with government bureaucracy. Occasionally, he would write letters to ministries recommending that some applicants be granted loans. He also traveled regularly across the country, meeting his supporters in cities and rural provinces.

Ahmadinejad speaks to his ally Saeed Jalili, an 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 they allowed him to sit alongside other senior officials in a high-level council that advises the Iranian Supreme Leader. He attended a meeting of that council in February, a few days before the outbreak of the war.