An Outline of the History of Restriction on Ijtihad
He speaks not out of caprice. (53:3)
Hence al-Maqrizi's statement that "the ten (Companions) who were given the good tidings of paradise (al-asharah al-mubashsharah) used to issue fatwas during the lifetime of the Prophet (s)",  suggesting an early emergence of ijtihad and the practice of issuing fatwa, underrates the station of the Prophet (s) and is derogatory to these Companions, for their mere faith did not permit them to do so, except when they were ordered to do so by the Prophet (s), and that too not in opposition to him.
Similarly, there is no doubt that legal issues (furu') were not the subject of the first controversy that occurred in Islam. All historical accounts agree that the first difference to occur amongst Muslims following the death of the Prophet (s) and prior to his burial wits concerning the issue of khilafah and wilayah.
This disagreement also did not exist during the lifetime of the Prophet (s), since not a single history mentions it. On the contrary, while the Prophet (s) was alive all the Muslims concurred with the order of their Prophet in taking the oath of allegiance (bay'ah) to his cousin on the day of Ghadir, with all the details mentioned in all the books of history and sirah?  Hence, while he was alive they acknowledged the wilayah (guardianship), wizarah (vaziership), wisayah (trusteeship), khilafah (vicegerency), and imamah (leadership) of his cousin, in accordance with the explicit statements of the Prophet (s) regarding all these matters on various occasions from the time of his bi'thah (beginning of his ministry) in Makkah to the time of his demise in Madinah. During this span of time, not a single voice of dissent was ever heard from among the Companions. 
There is again no doubt that after the demise of the Prophet (s) the Ummah in its entirety was not unanimous about the khilafah of a particular person from the community. Rather, immediately after the Prophet's demise, some persons of the community took the lead in breaking the oath of allegiance taken at Ghadir and initiated the rejection of wilayah. This rejection and dissidence spread gradually to others. Thereafter the affair of the khilafah was decided as a result of the efforts of some prominent persons of the Muslim community who preoccupied themselves with directing the matter of succession and nomination of another person to the office, making arrangements that lead to the formation of a majority from numerous groups within a few days.
Following the controversy among prominent persons from among the Muhajirun and the Ansar, as well as others, the outcome was a split into two groups: the Shi'ah (Khassah) and the generality of people ('Ammah). The Khassah was the group which remained with the Wasi (i.e. 'Ali ['a]) and loyal to his wilayah. The 'Ammah were those who distanced themselves from him. This was beginning of the difference.
Then the minority group which remained loyal to the bay'ah of the Wasi, acknowledged his title to the Imamah, and believed in his infallibility ('ismah) and obedience to him as a duty ordained by God, the Exalted, considered it binding upon itself to follow him in religious precepts (al-ahkam al-diniyyah) which God had conveyed to His prophet and which the latter had entrusted to his wasi, confiding all of them to him while proclaiming to the people:
I am the city of Divine knowledge and 'Ali is its gateway.