Hadithcore
Mishkat al-Masabih, 3912

Ibn ‘Abbas reported the Prophet (ﷺ) as saying, "The best number of companions is four, the best number in expeditions four hundred, and the best number in armies four thousand; and twelve thousand will not be overcome through smallness of numbers." Tirmidhi, Abu Dawud and Darimi transmitted it, Tirmidhi saying this is a <i>gharib</i> tradition.

وَعَنِ ابْنِ عَبَّاسٍ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: «خَيْرُ الصَّحَابَةِ أَرْبَعَةٌ وَخَيْرُ السَّرَايَا أَرْبَعُمِائَةٍ وَخَيْرُ الْجُيُوشِ أَرْبَعَةُ آلَافٍ وَلَنْ يُغْلَبَ اثْنَا عَشَرَ أَلْفًا مِنْ قِلَّةٍ» . رَوَاهُ التِّرْمِذِيُّ وَأَبُو دَاوُدَ وَالدَّارِمِيُّ وَقَالَ التِّرْمِذِيُّ: هَذَا حَدِيث غَرِيب

References1 variant
In-Book Reference
Book 19, Hadith 124