The Twelve Quraysh Khulafa
Sayydina Jabir ibn Samurah (ra) narrated: The Prophet (pbuh) said, There will be twelve caliphs. All of them will be Quraysh. (Bukhari 7222, 7223, Muslim 1821/6, Abu Dawud 4280)
The same Hadith is found in Abu Dawud through another line of transmission from Jabir (ra). According to a version, he said, "This ummah will continue to be on its condition and subdue the enemy till twelve khilafah have ruled over it, all of whom will be Quraysh." The sahaba asked him, "What will happen thereafter?" He said, "There will be farj". (farj means division into sects and weakness of soul, cleave asunder, split.) The twelve caliphs in these two Ahadith, do not mean the twelve imams as the rawafid (shia) imagine. They lie about them and allege that they were innocent because, except for Sayyidina Ali (ra) and his son, Sayyidina Hasan, none of these eminent men became a caliph or governor (while the Hadith uses the words Khilafah)
Not the twelve who succeeded each other as khilafah
These twelve are not they who succeeded each other after the Prophet (pbuh) up to the era of the Banu Umayyah because the hadith of Sayyidina Safinah (ra) quotes the Prophet (pbuh) as saying, "The khilafah will last thirty years after me."(Abu Dawud, Trimizi, Ahmad). Of these twelve khulafah, four are the righteous caliphs Sayyidina Abu Bakr (ra), Umar (ra), Uthman (ra) and Ali (ra), and the fifth is Sayyidina Hasan ibn Ali (ra). The rest include Umar ibn Abdul Aziz and some of the Banu Abbas, and in later period, so much so that Mahdi will be one of them.