Ahmadinejad
Iran's President Mahmoud Ahmadinejad in front of the shrine of Prophet Mohammed's grandson Hussein ibn Ali at the Al-Hussein mosque in Cairo (Reuters)

Mahmoud Ahmadinejad's political career has finally reached its nadir, with the Iranian President facing an unprecedented series of political humiliations at home, as well as shoe attacks and protests abroad.

While the President is paying a controversial three-day official visit to Egypt, one of his closest aids has been arrested and one of his ministers impeached by Tehran's increasingly hostile parliament.

Ahmadinejad is to step down from the presidential office in June, as he is barred from running for a third consecutive term at the incoming presidential elections, but his eight-year legacy seems destined to end amid political reprisal and public shame.

Shoe attacks and outrage in Cairo

The first Iranian president to land on Egyptian soil since Tehran's 1979 Islamic revolution, Ahmadinejad received a red-carpet welcome at Cairo's airport from his counterpart Mohammed Mursi.

However the people's reception in the capital's streets wasn't as warm.

Angry Sunni protesters gathered to demonstrate over Ahmadinejad's Shiite-led government's support for the regime of Syrian President Bashar al-Assad.

As Ahmadinejad was visiting the famous central al-Hussein mosque, a man shouting "coward" and tried to hit him with a shoe, a practice considered as a grave insult in Arab countries.

The same treatment was meted out to former US president George W. Bush, who famously dodged a shoe thrown by a journalist during a press conference in Baghdad in September 2009.

The Cairo attack was captured on video and uploaded to YouTube by Turkish news agency Anadolu, which claimed that the shoe-brandishing assailant was a Syrian angered at Ahmadinejad for "killing his brothers."

Ahmadinejad dodged the strikes and the man was arrested after being apprehended by the president's security guards.

However Ahmadinejad's shoe nightmare wasn't yet over, as a number of anti-Iranian shoe-waving protesters were waiting for him at the main gates of Al-Azhar, the Sunni world's most prestigious religious hub, where the president met Egypt's most prominent cleric Ahmed al-Tayyeb.

During the meeting, al-Tayyeb severely criticised Tehran's interference in the affairs of Gulf nations, particularly Bahrain, where the ruling Sunni minority has faced protests by the Shiite majority and the backing of Assad's regime.

The religious leader also demanded that Ahmadinejad speak out in defence of some Sunni beliefs, linked to the centuries-old split between Islam's Shiite and Sunni sects.

Ahmadinejad Cairo
Iran's President Mahmoud Ahmadinejad speaks with Sheikh Ahmed al-Tayeb, Egypt's leading Sunni Muslim scholar at the historic al-Azhar mosque and university, in Cairo (Reuters)

Bad Videotapes and Public humiliation

Other troubles are waiting for Ahmadinejad upon his return to Tehran.

The night before Ahmadinejad's landing in Cairo, one of his closest allies, Saeed Mortazavi, was arrested over his alleged role in the torture and killing of prisoners.

Mortazavi was accused by a 2010 parliamentary investigation of responsibility for the death by torture of at least three anti-government protesters jailed during the violent repression of demonstrations against Ahmadinejad's re-election the previous year.

Despite the allegations, Mortazavi, who then served as Tehran's prosecutor general, was never prosecuted but was instead promoted to head of Iran's social welfare fund.

Mortazavi's arrest reflects the increasing erosion of Ahmadinejad's power in the country, which began he reportedly fell from grace with Iranian Supreme Leader Ayatollah Ali Khamenei in 2011.

Ultra-conservative forces slam the presidency for mishandling the currency crisis and wider economic crunch due to international sanctions against Iran's nuclear programme.

Ahmadinejad and his entourage accused the judiciary, formed by hard-line conservatives, of imprisoning people close to the president to put pressure on him.

Hours before Mortazavi's arrest, Ahmadinejad was publicly humiliated in parliament on a related matter by his fiercest political opponent and tipped successor, the parliamentary speaker Ali Larijani.

MPs were debating the impeachment of Ahmadinejad's employment and welfare minister, Abdolreza Sheikholeslami, over the appointment of Mortazavi as head of Iran's social welfare fund.

Addressing MPs, Ahmadinejad attempted to divert their attention by accusing Larijani's brother Fazel of having attempted to bribe Mortazavi to gain political protection.

The president said he was in possession of video evidence, and Larijani demanded for it to be shown.

Ahmadinejad played a video depicting Fazel discussing with Mortazavi, but the audio was very poor and for long parts almost inaudible, frustrating the president's goal.

Ali Larijani accused Ahmadinejad of using it as a "threat" to hamper the impeachment process, behaving like a "Mafioso".

"It was a good thing that you showed this to let people learn about your character," Larijani said.

The matter was set aside and MPs voted for Sheikholeslami's impeachment with an overwhelming majority.

The dramatic showdown was broadcasted live on state radio. Mortazavi has reportedly been released from police custody after 24-hours.

Mahmoud Ahmadinejad
Iran's President Mahmoud Ahmadinejad leaves after visiting the Al-Hussein mosque where a man tryed to hit him with a shoe (Reuters)