The word "imam" in Arabic means "leader". In Islamic terminology it generally refers to any person who leads others in prayer. According to the early Sunni theologians, the Imam is the leader of the Islamic community, and his function is to enforce the revealed Law or Shari'ah. As such the term is equivalent to "caliph". In Sunnism it may also be an honorific term, given to certain important religious leaders, such as Imam Shafi'i, founder of one of the four Sunni schools of law. In Twelve-Imam Shi'ism it has two important meanings. As in Sunnism, the leader of others in prayer is called an "imam", especially the person who performs this function on a regular basis in a mosque. But more specifically, an Imam is one of the twelve successors of the Prophet listed below.
The specific meaning given to the word "imam" in Shi'ism can not be understood until one grasps the basic difference between the Sunni and Shi'ite branches of Islam. The roots of this difference are to be found in the differing views held by the companions of the Prophet concerning the nature of his successor or caliph. The Prophet himself performed three basic functions: He acted as the means whereby a celestial book, the Quran, was revealed by God to mankind. Thus he was the founder of a world religion. He was also the ruler of the early Islamic community, which means that he enforced the Shari'ah which God had revealed through the Quran. Finally he was the possessor of spiritual illumination and vision, and as such he could interpret the inner meaning of the Revelation and guide men upon the ascending stages of the path of spiritual perfection.
According to the majority of Muslims, the Sunnis, the successor of the Prophet must fulfill only one of these functions, i.e., he should enforce the Shari'ah. Muhammad had been the last Prophet, so there could be no prophet after him. And there was no way the community could guarantee that his successors would possess spiritual vision and illumination, for like prophecy, these things are divinely bestowed (although unlike prophecy, they could still be possessed by men). But undoubtedly, the Prophet's successor could act as a ruler and enforce the Shari'ah. In fact, the earthly existence of Islam largely depended upon this function being fulfilled, particularly at its beginning. Finally, the Sunnis held that the Prophet had not appointed a successor during his lifetime, so it was up to them to choose one.
But the minority group, known as the "Shi'ites" (the "partisans" of 'Ali), maintained that the Prophet's successor must not only enforce the Shari'ah, he must also possess divinely illuminated wisdom and be the spiritual guide of men. Since this latter function is bestowed by God and cannot be judged by the majority of men, the Prophet's successor must be divinely appointed, as expressed in the Prophet's wishes. And the Shi'ites hold that the Prophet had in fact appointed 'Ali as his caliph. 
This difference in view between the Shi'ites and Sunnis was often expressed in political terms, resulting in a good deal of strife in the early centuries of Islam between certain Shi'ite groups and the Umayyad and Abbasid caliphs. For, as far as the Shi'ites were concerned, the Imams were the only completely legitimate successors to the Prophet. The first, 'Ali, was appointed by the Prophet himself, and each in turn was appointed by his predecessor according to divine decree.
The beloved daughter of the Prophet from Khadijah, Fatimah was born in Mecca five years before the beginning of the Prophet's mission. She was so loved by the Prophet that he called her "a part of me." In 2/624 she married 'Ali ibn Abi Talib from whom she bore three sons, Hasan, Husayn and Muhsin (who died stillborn), and two daughters, Zaynab and Urnm Kulthum. She was at the Prophet's bedside at the moment of his death and fought for her husband's succession to the caliphate. She died six months after her father in the year II/633 and is buried in the Baq'i cemetery in Medina. It is said that when she was born the whole sky became illuminated; therefore she is called al-Zahra', the "Radiant." She is the mother of the Shi'ite Imams and is considered the most holy of Muslim women.
I. The First Imam, 'Ali (b. A.D. 600, d. A.H. 40/A.D. 661)
He was the son of the Prophet's paternal uncle, Abu Talib, who had raised the Prophet like his own son and protected him after he declared his mission. According to the Shi'ites, 'Ali was the first to accept the new religion at the hands of the Prophet, at the age of ten. He was the greatest warrior of early Islam, and according to his partisans was appointed by the Prophet as his successor at a place known as ''Ghadir al-Khumm". He became the fourth Sunni caliph, the last of the "Rightly-Guided Caliphs", after the death of 'Uthman. He was finally assassinated by followers of the Khawarij (an early schismatic sect), after five years as caliph. He is buried in Najaf in Iraq.
II. The Second Imam, al-Hasan (3/62 -50/670)
He was the elder son of 'Ali by the Prophet's daughter Fatimah. He laid claim to the caliphate for some six months after the death of his father, but was finally forced to surrender it to Mu'awiyah. For the rest of his life he lived in Medina in seclusion. He is buried in the Baq'i cemetery in Medina.
III. The Third Imam, al-Husayn (4/62 -6I/680)
The younger son of 'Ali by Fatimah, like his brother he lived most of his life quietly in Medina under the watchful eyes of the caliph's officials and spies. When Mu'awiyah's son Yazid became caliph, he demanded allegiance from al-Husayn, who refused to give it. Finally al-Husayn felt it necessary to go into battle against Yazid to protest against the injustices which were being carried out in the name of Islam. He and a small group of followers including most of his immediate family were cruelly massacred at Karbala The day of his martyrdom ("'Ashura") has become the most solemn day of the Shi'ite calendar, marked by processions and universal mourning. Its celebration symbolizes the whole ethos of Shi'ism. He is buried in Karbala in Iraq.
IV. The Fourth Imam, 'Ali, known as Zayn al-'Abidin and al-Sajjad (38/65895/7I2)
The son of Imam al-Husayn by the daughter of Yazdigird, the last Sassanid king of Iran, he was not able to carry arms at Karbala because of illness, and thus he was saved the fate of his three brothers. For most of his life he lived in seclusion in Medina, having contact with only a few select followers. His piety-which is reflected in his collected prayers, al-Sahifat al-sajjadiyyah-is proverbial. He is buried in the Baqi' cemetery in Medina.
V. The Fifth Imam, Muhammad, known as al-Baqir (57/675II4/732)
The son of the fourth Imam, he was present at Karbala at a young age. Because of changing political and religious conditions, among them the general revulsion following the events at Karbala, many people came to Medina to learn the religious and spiritual sciences from him. He trained numerous well-known men of religion, and mainly for this reason is the first Imam after 'Ali from whom large numbers of traditions are recorded. He is buried in the Baqi' cemetery in Medina.
VI. The Sixth Imam, Ja'far, known as al-Sadiq (83/702-148/765)
The son of the fifth Imam, he lived in an increasingly favorable climate and was able to teach openly in Medina. Large numbers of scholars gathered around him to learn, including such famous Sunni figures as Abu Hanifah, the founder of one of the four Sunni schools of law. Towards the end of Imam Ja'far's life severe restrictions were placed upon his activities, as a result of growing Shi'ite unrest. More traditions are recorded from him than from all the other Imams together. He is so important for Twelve-Imam Shi'ite law that it is named the "Ja'fari School" after him. He is buried in the Baqi' cemetery in Medina.
VII. The Seventh Imam, Musa, entitled al-Kazim (128/744-183/799)
The son of the sixth Imam, he was contemporary with such Abbasid caliphs as al-Mansur and Harun al-Rashid. He lived most of his life in Medina with severe restrictions placed upon him and finally died in prison in Baghdad. After him, the Imams were often not able to live in their traditional home of Medina, but were forced to remain near the caliph in Baghdad or Samarra. He is buried in Kazimayn in Iraq.
VIII. The Eighth Imam, 'Ali, known as al-Rida (148/765-203/817)
The son of the seventh Imam, he lived in a period when the Abbasids were faced with increasing difficulties because of Shi'ite revolts. Finally the caliph al-Ma'mun thought he would solve the problem by naming the Imam as his own successor, hoping thus to ensnare him in worldly affairs and turn the devotion of his followers away from him. After finally being able to persuade al-Rida to accept, al-Ma'mun realized his mistake, for Shi'ism began to spread even more rapidly. Finally he is said to have had the Imam poisoned. Al-Rida is buried in Mashhad in Iran.
IX. The Ninth Imam, Muhammad, known as al-Taqi (195/809-220/835)
The son of the eighth Imam, he was given the daughter of the caliph al-Ma'mun in marriage and for a time was kept by the caliph in Baghdad. But he was able to return to Medina until the end of al-Ma'mun's reign. The new caliph, al-Mu'tasim, summoned him back to Baghdad where he died. He is buried in Kazimayn in Iraq.
X. The Tenth Imam, 'Ali, known as al-Naqi (212/827-254/868)
The son of the ninth Imam, he remained in Medina teaching the religious sciences until 243/857, when he was summoned to Samarra by the caliph al-Mutawakkil. There he was treated harshly by the caliph and his successors until he died. He is buried in Samarra.
XI. The Eleventh Imam, al-Hasan, called al-'Askari (232/845-260/872)
The son of the tenth Imam, he lived in close confinement in Samarra under the watchful eye of the caliph, especially since it was known that the Shi'ites were awaiting his son, the twelfth Imam, who was to be the promised Mahdi or "guided one", destined to remove injustice from the world. The eleventh Imam married the daughter of the Byzantine emperor, Nargis Khatun, who, following instructions given her in a dream, had sold herself into slavery to become his wife. He is buried in Samarra.
XII. The Twelfth Imam, Muhammad, known as al-Mahdi (b. 256/868)
The twelfth Imam lived in hiding under the protection and tutelage of his father until the latter's death. Then he went into "occultation". In other words, he became hidden from the eyes of ordinary men and appeared only to his Deputies (see p. 92.)
In the year 329/939 his "greater occultation" began. It will continue as long as God wills, but when he does appear once again, he will erase evil and injustice from the world.
 For a detailed account, see Shi'ite Islam.
 For a profound and illuminating explanation of the basic difference in perspective represented by Sunnism and Shi'ism see F. Schuon, Islam and the Perennial Philosophy, London, 1976, ch. 5.