كتاب الصلاة
4  
The Book of Prayers
(31)
Chapter: Moderation When Reciting Qur'an In A Prayer When It Is To Be Recited Out Loud, And Making it Neither Too Loud Nor Too Soft, And When There Is The Fear Of Negative Consequences If It Is Recited Out Loud
(31)
باب التَّوَسُّطِ فِي الْقِرَاءَةِ فِي الصَّلاَةِ الْجَهْرِيَّةِ بَيْنَ الْجَهْرِ وَالإِسْرَارِ إِذَا خَافَ مِنَ الْجَهْرِ مَفْسَدَةً
Sahih Muslim 446

Ibn 'Abbas reported:

The word of (Allah) Great and Glorious: 'And utter not thy prayer loudly, nor be low in it" (xvii. 110) was revealed as the Messenger of Allah (may peace beupon him) was hiding himself in Mecca. When he led his Companions in prayer he raised his voice (while reciting the) Qur'an. And when the polytheists heard that, they reviled the Qur'an and Him Who revealed it and him who brought it. Upon this Allah, the Exalted, said to His Apostle (ﷺ): Utter not thy prayer so loudly that the polytheists may hear thy recitation and (recite it) not so low that it may be inaudible to your Companions. Make them hear the Qur'an, but do not recite it loudly and seek a (middle) way between these. Recite between loud and low tone.
حَدَّثَنَا أَبُو جَعْفَرٍ، مُحَمَّدُ بْنُ الصَّبَّاحِ وَعَمْرٌو النَّاقِدُ جَمِيعًا عَنْ هُشَيْمٍ، - قَالَ ابْنُ الصَّبَّاحِ حَدَّثَنَا هُشَيْمٌ، - أَخْبَرَنَا أَبُو بِشْرٍ، عَنْ سَعِيدِ بْنِ جُبَيْرٍ، عَنِ ابْنِ عَبَّاسٍ، فِي قَوْلِهِ عَزَّ وَجَلَّ ‏{‏ وَلاَ تَجْهَرْ بِصَلاَتِكَ وَلاَ تُخَافِتْ بِهَا‏}‏ قَالَ نَزَلَتْ وَرَسُولُ اللَّهِ صلى الله عليه وسلم مُتَوَارٍ بِمَكَّةَ فَكَانَ إِذَا صَلَّى بِأَصْحَابِهِ رَفَعَ صَوْتَهُ بِالْقُرْآنِ فَإِذَا سَمِعَ ذَلِكَ الْمُشْرِكُونَ سَبُّوا الْقُرْآنَ وَمَنْ أَنْزَلَهُ وَمَنْ جَاءَ بِهِ فَقَالَ اللَّهُ تَعَالَى لِنَبِيِّهِ صلى الله عليه وسلم ‏{‏ وَلاَ تَجْهَرْ بِصَلاَتِكَ‏}‏ فَيَسْمَعَ الْمُشْرِكُونَ قِرَاءَتَكَ ‏{‏ وَلاَ تُخَافِتْ بِهَا‏}‏ عَنْ أَصْحَابِكَ أَسْمِعْهُمُ الْقُرْآنَ وَلاَ تَجْهَرْ ذَلِكَ الْجَهْرَ وَابْتَغِ بَيْنَ ذَلِكَ سَبِيلاً يَقُولُ بَيْنَ الْجَهْرِ وَالْمُخَافَتَةِ ‏.‏
Reference : Sahih Muslim 446
In-book reference : Book 4, Hadith 163
USC-MSA web (English) reference : Book 4, Hadith 897
  (deprecated numbering scheme)