Abu Bakr, a close companion of Muhammad, is unanimously selected as the first caliph of Islam.
In early Islamic history the Shia were a political faction that supported Ali, son-in-law of the prophet Mohammed, who was the fourth caliph , the temporal and spiritual ruler of the Muslim world.
Imam Ali is the fourth caliph to the Muslim, to the Sunni Muslims, and he is the first successor of the Prophet according to the Shia Muslims.
In orthodox writings the title caliph generally means deputy or successor to the Prophet Muhammad (as in khalifat rasul Allah - deputy to the Messenger of God).
By 1055, the Seljuks had spread across Iran to Iraq, where in Baghdad Seljuk's grandson Tughrul liberated the caliph , the supreme religious leader of the Islamic faith, from the control of another dynasty.
Their only source of identity was Islam, for the sultan was the caliph , the successor to Mohammad, and the only legitimate leader of all Muslims.
Historically, for the Muslim community to act, the leader of that community - the caliph for the Sunnis, the imam for the Shi'ites - had to authorize the action.
The difference between a caliph and an imam is that a caliph can be anyone accepted by Muslims, but an imam must hail from the Prophet Mohammed's family and be a recognized religious authority (clergy).
Ali, who was the fourth caliph of Sunni Islam and the first Shia imam, disagreed with Umar's decision at the time, as did other leading Sahaba, or companions of the Prophet.
The sultan was also the caliph , the symbol of Islamic unity and piety.