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 (saaw) 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 is to be found in the differing views held by the companions of the Prophet (saaw) concerning the nature of his successor or caliph. The Prophet (saaw) himself performed three basic functions:
•He acted as the means whereby a celestial book, the Quran, was revealed by Allah(swt) 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 Allah(swt) 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(saaw) must fulfill only one of these functions, i.e. he should enforce the Shari’ah. Muhammad(saaw) 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).
Undoubtedly, the Prophet’s(saaw) 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(saaw) 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(as)), maintained that the Prophet’s(saaw) 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 Allah(swt) and cannot be judged by the majority of men, the Prophet’s(saaw) successor must be divinely appointed, as expressed in the Prophet’s(saaw) wishes. The Shi’ites hold that the Prophet(saaw) had in fact appointed ‘Ali(as) as his caliph. This difference in view between the Shia’s 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(as) were the only completely legitimate successors to the Prophet (saaw). The first, ‘Ali(as), was appointed by the Prophet himself, and each in turn was appointed by his predecessor according to divine decree.
The Twelve Imams
I. The First Imam, ‘Ali al-Murtada(as) He was the son of the Prophet’s(saaw) paternal uncle, Abu Talib, who had raised the Prophet(saaw) like his own son and protected him after he declared his mission. According to the Shi’ites, ‘Ali(as) was the first to accept the new religion at the hands of the Prophet(saaw), at the age of ten. He was the greatest warrior of early Islam, and according to his partisans was appointed by the Prophet(saaw) 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. [Read: Nahjul-Balaghah ]
II. The Second Imam, al-Hasan al-Mujtaba(as) He was the elder son of ‘Ali(as) by the Prophet’s daughter Fatimah (as). 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 Sayyed al-Shuhada(as) The younger son of ‘Ali(as) by Fatimah(as), 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(as), who refused to give it. Finally al-Husayn(as) 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 commemoration symbolizes the whole ethos of Shi’ism. He is buried in Karbala in Iraq.
IV. The Fourth Imam, ‘Ali Zayn al-‘Abidin, al-Sajjad(as) The son of Imam al-Husayn(as) 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-Sahifah al-Sajjadiyyah is proverbial. He is buried in the Baqi’ cemetery in Medina.
V. The Fifth Imam, Muhammad al-Baqir(as) The son of the fourth Imam(as), 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(as) from whom large numbers of traditions are recorded. He is buried in the Baqi’ cemetery in Medina.
VI. The Sixth Imam, Ja’far al-Sadiq(as) The son of the fifth Imam(as), 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(as) 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(as) 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 al-Kazim(as) The son of the sixth Imam(as), 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 al-Rida(as) The son of the seventh Imam(as), 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) 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(as) 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 (as) poisoned. Al-Rida(as) is buried in Mashhad in Iran.
IX. The Ninth Imam, Muhammad al-Jawad(as) The son of the eighth Imam(as), 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 al-Hadi(as) The son of the ninth Imam(as), 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 al-‘Askari(as) The son of the tenth Imam(as), 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(as), who was to be the promised Mahdi or “guided one”, destined to remove injustice from the world. The eleventh Imam(as) 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 al-Mahdi(as) The twelfth Imam(as) 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. 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.
The above was taken from A Shi’ite Anthology By Allamah M. H. Tabatabai Why should the number of Imams(as) be twelve and twelve only? IN FACT, the answer is right inside the Sihah ahadith books (like al-Bukhari, Muslim, Musnad Ahmad, Sunan Abu Dawud, al-Tirmidhi,etc.). There are numerous Sunni collections of traditions which all recorded the following authentic traditions from the Holy Prophet Mohammad(saaw).
“There will be twelve commanders (Amir)” … “All of them will be from Quraish.”
“The matter (life) will not end, until it is passed by twelve Caliphs” … “All of them will be from Quraish.” 
“The affairs of people will continue to be conducted (well) as long as they are governed by the twelve men.” 
“Islam will continue to be triumphant until there have been twelve Caliphs.” 
“The Islamic religion will continue until the Hour (day of resurrection), having twelve Caliphs for you, all of them will be from Quraish.” 
“There shall be twelve Caliphs for this community, all of them from Quraish.” 
“Twelve Caliphs, (like) the number of the Chiefs of Bani Israel.” 
“There will be after me twelve Amir (Prince/Ruler), all of them from Quraysh.” 
“This religion remains standing until there are twelve vicegerents over you, all of them agreeable to the nation, all of them from Quraysh.” 
“Islam will continue to be triumphant until there have been twelve Caliphs” … “All of them are from Quraysh.” 
“This nation will always remain straight in its affairs, and triumphant against the enemies, till twelve Caliphs will be among them; all of them from Quraysh. Then there will be discord and confusion.” 
“There will be twelve upright Imams for this nation. Those who try to disgrace them will not succeed; all of them shall be from the Quraysh.” 
“The affair of the people will continue as long as twelve men rule over them.” 
“This religion will remain till twelve Imams from Quraysh (will pass), then when they expire the earth will swallow its inhabitants.”
“The affair of this nation will always be apparent till the twelve Imams will rise, all of them from the Quraysh.” [12
]”There will be Caliphs after me, whose number is like those of the companions of Musa.” 
Sahih al-Bukhari 9:329 (Arabic-English version)  Sahih Muslim, Arabic version, Kitab al-Imaarah, 1980 Edition Pub. in Saudi Arabia, v3, p1452, Tradition #5 Sahih Muslim, English version, Chapter DCCLIV (titled: The People are subservient to the Quraish and the Caliphate is the Right of the Quraish), v3, p1009, Tradition #4477.  Ibid p1010, Tradition #4478  Ibid p1010, Tradition #4480  Ibid p1010, Tradition #4483  Musnad Ahmad Ibn Hanbal, v5 p106:  Ahmad b. Hanbal, Musnad, v1 p398 and p406. Al-Hakim al-Nisaburi, Mustadrak , 4:501 Al-Dhahabi, Talkhis 4:501. Ibn Hajar al-‘Asqalani, Fath al-Bari 16:339. Ali b. Abu Bakr al-Haythami, Majma’ al-Zawa’id 5:190. Ibn Hajar al-Haythami, Al-Sawa’iq al-Muhriqa, vol 12. Al-Suyuti, Tarikh al-Khulafa, Vol 10. Jami’ al-Saghir 1:75. Al-Muttaqi al-Hindi, Kanz al-‘Ummal, 13:27.  Sunan al-Tirmidhi (Arabic) Chapter of Fitan, 2:45 (India) and 4:501 Tradition # 2225 (Egypt)  Sunan Abu Dawud (Arabic) 2:421, Kitab al-Mahdi. Sunan Abu Dawud (Arabic) 3:106, Kitab al-Mahdi.  Sunan Abu Dawud (Arabic) 2:421, Kitab al-Mahdi. Sunan Abu Dawud (Arabic) 3:106, Kitab al-Mahdi. Ibn Hajar al-‘Asqalani, Fath al-Bari 16:338. Al-Hakim al-Nisaburi, Mustadrak al-Sahihayn 3:167.  Muntakhab Kanz al-‘Ummal 5:321. Ibn Kathir, Ta’rikh, 6:249. Al-Suyuti, Tarikh al-Khulafa, Vol 10. Al-Muttaqi al-Hindi, Kanz al-‘Ummal ,13:26. Ibn Hajar al-Haythami, Al-Sawa’iq al-Muhriqa Vol 28.  Al-Muttaqi al-Hindi, Kanz al-‘Ummal , 13:27  Ibn Kathir, Ta’rikh, 6:248. Al-Muttaqi al-Hindi, Kanz al-‘Ummal, 13:27. Al-Haskani, Shawahid al-Tanzil, 1:455, Tradition No. 626.
The Meaning of these Traditions: In some Traditions, the power of Islam is referred to as being a pawn in the twelve caliphs, and in others, the survival and life of religion are in the hands of a group of them until the Day of Resurrection, and all are from the Quraysh. In some, all of them are mentioned as being of the Bani Hashim.
These Traditions do not conform to any Muslims except the Shia (Twelvers) because their explanation is very clear according to Shi’ism where the Sunni ulama are at an impasse trying to explain it. Does it refer to the first four caliphs and then the Umayyad and Abbassid caliphs?
The famous scholar, Sulayman ibn Abrahim al-Qaduzi al-Hanafi said in his book Yanabi’a al-Muwaddah: “Some of the scholars have said that, ‘The Tradition which mentions the rule of the caliphs after the Prophet(saaw) are twelve people is famous and it has been recorded in many places. That which we can surmise is that, after the passing of time, what the Prophet(saaw) was referring to was twelve successors from the Ahlul-Bayt(as) his family because it is not possible that this Tradition refer to the first caliphs because they are only four people and it does not conform to the Umayyads because they were more than twelve people and all of them, other than Amr ibn Abdul Aziz were oppressors and also, they were not from the Bani Hashim and the Holy Prophet(saaw) said, “All twelve are from the Bani Hashim.”
When Abdul Malik ibn Umar records from Jabir ibn Sahrah and how the Prophet(saaw) quietly said who they were from, he bore witness to what he said because some people were not happy about the caliphate of the Bani Hashim and the Tradition does not conform to the Bani Abbas, either, because they were more than twelve people and beyond this, they did not conform to the verse, “No reward do I ask of you except the love of those near of kin…” (42:23)
Thus, the Tradition only can relate to the twelve Imams of the Ahlul-Byt(as) the family of the Prophet(saaw). It refers to those whose knowledge is higher than that of any others, whose piety is unquestioned and from all points of view, are more knowledgeable and who gained their knowledge from the Prophet(saaw). That which confirms this view is the Tradition of Thaqalayn and many other Traditions which have come from the Prophet (saaw). 
 Yanabi’a al-Muwaddah, p. 446 I would like to remind you that “Caliph” means successor/deputy.
The successor of the Prophet(saaw) (or the preceding Caliph) should come immediately after the demise of the Prophet (saaw) (or the preceding Caliph). If there is any gap between the successors, the word “successor” does not make any sense. So successors should come right after the other without any gap. Also as the Prophet(saaw) suggested in the above traditions, those twelve Caliphs will cover till the day of resurrection. As you may know, the Followers of Ahlul-Bayt(as) of the Holy Prophet(saaw) refer to these 12 Caliphs, as of their 12 Imams starting with Imam Ali(as) and ending with Imam al-Mahdi(as) the leader of our time. They are Caliphs because Allah(swt) made them Caliphs (They are vice-regents of Allah(swt) on the earth). With the passage of time and through historical events, we know that by the above traditions the Holy Prophet(saaw) meant the twelve Imams from his Ahlul-Bayt(as) who are the descendants of the Prophet(saaw) since we have no other 12 pure candidates in the history of Islam upon whose righteousness all Muslims agree.
It is interesting to know that even the enemies of Shia have NOT been able to find any fault in the virtues of the twelve Imams(as) of Shias. Moreover these twelve Imams(as) came one after another without any gap. It is now clear that the only way to interpret the previously mentioned traditions which are narrated in Sihah Books is to accept that it refers to the Twelve Imams(as) from the Prophet’s Ahlul-Bayt(as), because they were, in their times, the most knowledgeable, the most illustrious, the most God-fearing, the most pious, the best in personal virtues, and the most honored before Allah(swt); and their knowledge was derived from their ancestor (the Prophet(saaw) through their fathers.
These are the Ahlul-Bayt(as) whose sinlessness, flawlessness, and purity is confirmed by the holy Quran (the last sentence of verse 33:33). Also the above mentioned traditions of the Prophet(saaw) which are considered to be authentic by the Sunnis, proves beyond doubt that the concept of “Twelve Imams” can NOT be a Twelver Shi’a concoction! It is amazing that despite the acknowledgment of al-Bukhari and Muslim and other prominent Sunni scholars about the twelve Imams(as), the Sunnis always stop at the four Caliphs! More interestingly, there are Sunni reports in which the Prophet(saaw) named these twelve members of his Ahlul-Bayt(as) one by one starting with Imam Ali(as) and ending with Imam al-Mahdi(as).
The Names of The Twelve Imams(as): It should be noted that in some of the Traditions which have reached us from the Sunnis, the names of the twelve Imams(as) have clearly appeared and their names specified! Al-Juwayni  reports that Abdullah ibn Abbas remarked that the Messenger of Allah(saaw) said: “I am the chief of the Prophets and Ali ibn Abi Talib(as) is the chief of successors, and after me my successors shall be twelve, the first of them being Ali ibn Abi Talib(as) and the last of them being Al Mahdi(as)”. Al-Juwayni has also mentioned another tradition from Ibn ‘Abbas that he narrates from the Prophet(saaw): “Certainly my Caliphs and my legatees and the Proofs of Allah(swt) upon his creatures after me are twelve. The first of them is my brother and the last of them is my (grand)son.” He was asked: “O Prophet(saaw), who is your brother?” He said, “Ali ibn Abi Talib(as)” Then they asked, “And who is your son?” The Prophet(saaw) replied, “Al Mahdi(as), the one who will fill the earth with justice and equity like it would be brimming with injustice and tyranny. And by the One Who has raised me as a warner and a giver of good tidings, even if a day remains for the life of this world, the Almighty Allah(swt) will prolong this day to an extent till he sends my son Mahdi(as), then he will make Ruhullah ‘Isa ibn Maryam(as) to descend and pray behind him. And the earth will be illuminated by his radiance. And his power will reach to the east and the west.”
Al-Juwayni also narrates from his chain of narrators that the Prophet(saaw) informed: “I and Ali and Hasan and Husayn and nine of the descendants of Husayn (as) are the purified ones and the infallible.”
 Al-Dhahabi says in Tadhkirat al-Huffaz, vol. 4, p. 298, that Sadruddin Ibrahim bin Muhammad bin al-Hamawayh al-Juwayni al-Shafi’i was a great scholar of Hadith. Also see his biographical note in Ibn Hajar al-‘Asqalani, al-Durar al-kaminah, vol. 1, p. 67.
 Al-Juwayni, Fara’id al-Simtayn, pg160. Shaykh Sulayman al-Qanduzi, a famous Sunni scholar, in his book Yanabi’a al-Muwaddah said: “A Jewish man named Na’thal, went to the Prophet (s) and among the questions he asked who would succeed him. The Prophet (s) said, specifying them, “After me, ‘Ali ibn Abi Talib and then my two sons, Hasan and Husayn and after Husayn, nine Imams will follow from his children.” The Jewish man said, Name them. The Prophet (s) said: “When Husayn leaves this world, his son, ‘Ali, and after him, his child Muhammad and after Muhammad, his son Ja’far and after Ja’far, his son Musa and after Musa, his son ‘Ali and after ‘Ali, Muhammad. After Muhammad, his child, ‘Ali and after ‘Ali, Hasan and after Hasan, his child Muhammad al-Mahdi. These are the twelve Imams.” 
 Yanabi’a al-Muwaddah, p.431 Another Tradition is quoted from Kitab Manaqib with their titles and it indicates that Imam Mahdi(as) is in occultation and then he will arise and replace the oppression and tyranny which exists upon the earth with justice.  Yanabi’a al-Muwaddah, p.442: Taken From A Shi’ite Anthology By Allamah M. H. Tabatai.