Ali was the first Muslim, and the first to pray, accepting Islam at the age of 10.
Tarikh al-Tabari, Vol. 6, Page 83
Narrated Ibn Ishaq:

The first male to believe in the Messenger of God, to pray with him, and to accept the truth of the message he brought from God was 'Ali b. Abi Talib, who at that time was ten years old.

 

One of the favours which God bestowed on 'Ali b. Abi Talib was that the Messenger of God was his guardian before Islam.

Book  : Tarikh at-Tabari
Author  : Muhammad ibn Jarir al-Tabari (224 AH - 310 AH)
English reference  : Vol. 6, Page 83
Arabic reference  : 
Narrated by: Ibn Humayd, from Salamah from Ibn Ishaq.