Sahih Muslim , Hadith 2407

Salama b. Akwa' reported that it was 'Ali whom Allah's Apostle left behind him (in the charge of his family and the Islamic State) on the occasion of the campaign of Khaibar, and his eyes were inflamed and he said: Is it for me to remain behind Allah's Messenger? So he went forth and rejoined Allah's Apostle and on the evening of that night (after which) next morning Allah granted victory. Allah's Messenger said: I will certainly give this standard to a man whom Allah and His Messenger love. or he said: Who loves Allah or His Messenger and Allah will grant him victory through him, and, lo, we saw 'Ali whom we least expected (to be present on that occasion). They (the Companions) said: Here is 'Ali. Thereupon Allah's Messenger (may peace be upon hin) gave him the standard. Allah granted victory at his hand.

حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا حَاتِمٌ، - يَعْنِي ابْنَ إِسْمَاعِيلَ - عَنْ يَزِيدَ بْنِ أَبِي، عُبَيْدٍ عَنْ سَلَمَةَ بْنِ الأَكْوَعِ، قَالَ كَانَ عَلِيٌّ قَدْ تَخَلَّفَ عَنِ النَّبِيِّ صلى الله عليه وسلم فِي خَيْبَرَ وَكَانَ رَمِدًا فَقَالَ أَنَا أَتَخَلَّفُ عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم ‏.‏ فَخَرَجَ عَلِيٌّ فَلَحِقَ بِالنَّبِيِّ صلى الله عليه وسلم فَلَمَّا كَانَ مَسَاءُ اللَّيْلَةِ الَّتِي فَتَحَهَا اللَّهُ فِي صَبَاحِهَا قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ لأُعْطِيَنَّ الرَّايَةَ - أَوْ لَيَأْخُذَنَّ بِالرَّايَةِ - غَدًا رَجُلٌ يُحِبُّهُ اللَّهُ وَرَسُولُهُ أَوْ قَالَ يُحِبُّ اللَّهَ وَرَسُولَهُ يَفْتَحُ اللَّهُ عَلَيْهِ ‏" ‏ ‏.‏ فَإِذَا نَحْنُ بِعَلِيٍّ وَمَا نَرْجُوهُ فَقَالُوا هَذَا عَلِيٌّ ‏.‏ فَأَعْطَاهُ رَسُولُ اللَّهِ صلى الله عليه وسلم الرَّايَةَ فَفَتَحَ اللَّهُ عَلَيْهِ ‏.‏

sunnah.com