Sahih Bukhari Volume 4, Book 52, Hadith Number 219A.

Narated By Salama bin Al-Akwa : Ali remained behind the Prophet during the battle of Khaibar as he way suffering from some eye trouble but then he said, “How should I stay behind Allah’s Apostle?” So, he set out till he joined the Prophet. On the eve of the day of the conquest of Khaibar, Allah’s Apostle said, “(No doubt) I will give the flag or, tomorrow, a man whom Allah and His Apostle love or who loves Allah and His apostle will take the flag. Allah will bestow victory upon him.” Suddenly ‘Ali joined us though we were not expecting him. The people said, “Here is ‘Ali. “So, Allah’s Apostle gave the flag to him and Allah bestowed victory upon him.