The exam - sat by teachers seeking promotion - provoked outrage by posing questions which appeared to degrade Islam's holiest figure by alluding to personal habits and proclivities. Most of the 40 multiple-choice questions have been judged so mocking that Iran's state-controlled media has refrained from publishing them.

One less offensive question, reproduced by local newspapers and websites, lists four choices when asking how Muhammad compared himself with the prophet Joseph. They are: "A) I am more beautiful than Joseph; B) Joseph is more beautiful than me; C) I am cuter than Joseph; D) Joseph is more beautiful than me but I am cuter than him." Others refer to his hair and beard colour.

The national teachers' representative body protested after the test was given to diploma and higher-diploma level teachers in Tehran province. The local education authority admitted the questions were "in bad taste" and withdrew them. An alternative exam is being drawn up for teachers who failed, although the results of those with pass marks have been declared valid.

Some MPs branded the incident a deliberate plot to undermine Iran's Islamic system and likened it to last year's row over Danish cartoons satirising Muhammad, which provoked outrage throughout the Muslim world after they were published in several European newspapers.

"What is the difference between these questions and the caricatures drawn in Denmark against the prophet?" said Emad Afrough, the fundamentalist head of the cultural committee in Iran's parliament.

The latest row has spurred parliamentarians to begin preparations for impeaching the education minister, Mahmoud Farshidi, who has apologised for the tests. However, MPs have dismissed his mea culpa as insufficient and have called on Mr Ahmadinejad to apologise on the government's behalf.

The president has declined to comment directly but said in a speech this week in the northern province of Gilan: "The unity, authority and dignity of the Iranian nation stems from sticking to the dignified presence of the dear prophet of Islam, Muhammad."

Teachers were given 30 hours off classroom duties to study a biography of the prophet by the late Ayatollah Muhammad Tabatabai, a Shia philosopher whose teachings inspired many senior figures in Iran's Islamic revolutionary movement. Its strong focus on personal characteristics - including hygiene, physical appearance and eating habits - was the subject of staffroom gossip and jokes. "Some teachers were even exchanging notes on the book's content in text messages," one teacher told the newspaper Etemade Melli.

Personal questions

The test posed questions on the minutiae of the prophet Muhammad's life, including:

God's prophet never ate food with

a) Two fingers

b) Three fingers

c) Four fingers

d) Five fingers

God's prophet's hair was

a) Black

b) White

c) With the exceptions of a few hairs, predominantly black

d) Whitened at the end of his life

What colour was the prophet's beard?

a) Totally white, even upon his chin

b) Totally black, even over his chin

c) White over the chin and the rest salt and pepper

d) Salt and pepper over the chin and the rest white

On which side did God's prophet sleep?

a) On his back

b) On his chest

b) To the right

d) To the left