Update (below): Khamenei gives Ahmadinejad an ultimatum that could result in his resignation

Iranian President Mahmoud Ahmadinejad is mired in a political dispute with Supreme Leader Ayatollah Ali Khamenei that could result in the president's resignation, Al Jazeera English reported Friday.

The dispute is reportedly so severe that Ahmadinejad staged a 10-day walkout protest, during which time he was not seen in a single cabinet meeting.

This split between the men has now boiled over: as many as 25 people close to Ahmadinejad and his chief of staff, Esfandiar Rahim Mashaei, have been arrested and accused of sorcery, according to The Guardian.

The row between Ahmadinejad and Khamenei came to a head on April 17, when the president demanded that his intelligence minister resign. In a rare public reaction, Khameni rebuked the president and reinstated the minister, setting up a conflict between the two.

Ahmadinejad has refused to say that he accepts Khamenei's decision on the intelligence minister, even though under Iranian law defiance of the supreme leader is akin to defying his deity.

It has all led to reports that Ahmadinejad is considering resignation, or -- according to one member of Iran's parliament -- even asking Khamenei for permission to resign.

Whether that will happen remains to be seen, but Khamenei has reportedly been concerned for a long time about Ahmadinejad's growing power, and could potentially seize upon the row to force a change in leadership.

Update: Khamenei gives Ahmadinejad an ultimatum that could result in his resignation

A member of Iran's parliament said today that Ahmadinejad has been given an ultimatum: accept the supreme leader's decision regarding the intelligence minister, or resign from office.

The Guardian also reports that the president was missing this past weekend at religious ceremonies at Khamenei's residence, where he was publicly criticized by the supreme leader's allies.

The video below is from Al Jazeera English, broadcast May 6, 2011.

David Edwards contributed to this report.