Former President Mahmoud Ahmadinejad has shaken up Iran’s politics, with the registration of his candidacy in May’s Presidential election.

Ahmadinejad, who was President from 2005 to 2013, was told by the Supreme Leader last summer that he should not seek a return to office. He had publicly accepted the decision, but suddenly appeared at the election center in Tehran on Wednesday, surprising officials.

The ex-President was accompanied by his former Vice President Hamid Baghaei, who also filed his candidacy, and controverisal former Chief of Staff Esfandiar Rahim-Mashai. The three men held up linked hands and led chants of “Viva spring, Viva Iran”.

Observers immediately tried to explain the political twist. Some said it was simply a case of Ahmadinejad, craving attention, seizing his moment on the day after registration opened.

But Ahmadinejad’s calculations are likely to go beyond the momentary. He said that he was not filing for a campaign to get himself into the Presidency. Instead, he was supporting the campaign of Baghaei, the man he promoted last month as the alternative to both the current President, centrist Hassan Rouhani, and the conservative-hardline candidate — now Ebrahim Raisi, the head of a leading, wealthy religious organization — trying to take the office.

The former President said at a press conference alongside Baghaei, “I registered merely to support Baghaei and I will act according to the [supreme] leader’s advice….I’ll be serving Mr. Baghaei with all my power.”

Ahmadinejad is the expendable “stalking horse” who will be disqualified by the 12-member Guardian Council as it vets all prospective candidates. The logic is that the Council will then allow Baghaei through as a consolation, keeping his hopes alive and allowing Ahmadinejad to hold some limelight as his chief supporter.

There is precedent for this maneuver. In 2013, the Council banned former President Hassan Rafsanjani, fearing a centrist victory. However, it permitted Rouhani to stand. The “consolation” candidate then pulled off a surprise first-round victory after conservatives and hardliners failed to agree a single front-runner and argued over the men who eventually stood.

Ahmadinejad’s maneuver is likely to have a slim chance of success. Baghaei was arrested in 2015 and imprisoned for seven months for alleged corruption. In March, Iranian officials said he is still under investigation.

TOP PHOTO: Mahmoud Ahmadinejad (center) with former Chief of Staff Esfandiar Rahim-Mashai (left) and former Vice President Hamid Baghaei on Wednesday