كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(28)
Chapter: The Ghazwa of Ar-Raji’, Ri’l, Dhakwan and Bi’r Ma’una and the narration about Khubaib and his companions
(28)
باب غَزْوَةُ الرَّجِيعِ وَرِعْلٍ وَذَكْوَانَ وَبِئْرِ مَعُونَةَ
Sahih al-Bukhari 4088

Narrated `Abdul `Aziz:

Anas said, "The Prophet (ﷺ) sent seventy men, called Al-Qurra 'for some purpose. The two groups of Bani Sulaim called Ri'l and Dhakwan, appeared to them near a well called Bir Ma'una. The people (i.e. Al- Qurra) said, 'By Allah, we have not come to harm you, but we are passing by you on our way to do something for the Prophet.' But (the infidels) killed them. The Prophet (ﷺ) therefore invoked evil upon them for a month during the morning prayer. That was the beginning of Al Qunut and we used not to say Qunut before that." A man asked Anas about Al-Qunut, "Is it to be said after the Bowing (in the prayer) or after finishing the Recitation (i.e. before Bowing)?" Anas replied, "No, but (it is to be said) after finishing the Recitation."

حَدَّثَنَا أَبُو مَعْمَرٍ، حَدَّثَنَا عَبْدُ الْوَارِثِ، حَدَّثَنَا عَبْدُ الْعَزِيزِ، عَنْ أَنَسٍ ـ رضى الله عنه ـ قَالَ بَعَثَ النَّبِيُّ صلى الله عليه وسلم سَبْعِينَ رَجُلاً لِحَاجَةٍ يُقَالُ لَهُمُ الْقُرَّاءُ، فَعَرَضَ لَهُمْ حَيَّانِ مِنْ بَنِي سُلَيْمٍ رِعْلٌ وَذَكْوَانُ، عِنْدَ بِئْرٍ يُقَالُ لَهَا بِئْرُ مَعُونَةَ، فَقَالَ الْقَوْمُ وَاللَّهِ مَا إِيَّاكُمْ أَرَدْنَا، إِنَّمَا نَحْنُ مُجْتَازُونَ فِي حَاجَةٍ لِلنَّبِيِّ صلى الله عليه وسلم، فَقَتَلُوهُمْ فَدَعَا النَّبِيُّ صلى الله عليه وسلم عَلَيْهِمْ شَهْرًا فِي صَلاَةِ الْغَدَاةِ، وَذَلِكَ بَدْءُ الْقُنُوتِ وَمَا كُنَّا نَقْنُتُ‏.‏ قَالَ عَبْدُ الْعَزِيزِ وَسَأَلَ رَجُلٌ أَنَسًا عَنِ الْقُنُوتِ أَبَعْدَ الرُّكُوعِ، أَوْ عِنْدَ فَرَاغٍ مِنَ الْقِرَاءَةِ قَالَ لاَ بَلْ عِنْدَ فَرَاغٍ مِنَ الْقِرَاءَةِ‏.‏
Reference : Sahih al-Bukhari 4088
In-book reference : Book 64, Hadith 132
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 414
  (deprecated numbering scheme)