Sahih al-Bukhari, Hadith 6342 ⓘ
Narrated Anas: While the Prophet was delivering a sermon on a Friday, a man stood up and said, "O Allah's Messenger! Invoke Allah to bless us with rain." (The Prophet invoked Allah for rain.) So, the sky became overcast and it started raining till one could hardly reach one's home. It kept on raining till the next Friday when the same man or another man got up and said (to the Prophet), "Invoke Allah to withhold the rain from us, for we have been drowned (with heavy rain )." The Prophet said, "O Allah! Let it rain around us and not on us." Then the clouds started dispersing around Medina and rain ceased to fall on the people of Medina.
حَدَّثَنَا مُحَمَّدُ بْنُ مَحْبُوبٍ، حَدَّثَنَا أَبُو عَوَانَةَ، عَنْ قَتَادَةَ، عَنْ أَنَسٍ ـ رضى الله عنه ـ قَالَ بَيْنَا النَّبِيُّ صلى الله عليه وسلم يَخْطُبُ يَوْمَ الْجُمُعَةِ فَقَامَ رَجُلٌ فَقَالَ يَا رَسُولَ اللَّهِ ادْعُ اللَّهَ أَنْ يَسْقِيَنَا. فَتَغَيَّمَتِ السَّمَاءُ وَمُطِرْنَا، حَتَّى مَا كَادَ الرَّجُلُ يَصِلُ إِلَى مَنْزِلِهِ، فَلَمْ تَزَلْ تُمْطَرُ إِلَى الْجُمُعَةِ الْمُقْبِلَةِ، فَقَامَ ذَلِكَ الرَّجُلُ أَوْ غَيْرُهُ فَقَالَ ادْعُ اللَّهَ أَنْ يَصْرِفَهُ عَنَّا، فَقَدْ غَرِقْنَا. فَقَالَ " اللَّهُمَّ حَوَالَيْنَا وَلاَ عَلَيْنَا " . فَجَعَلَ السَّحَابُ يَتَقَطَّعُ حَوْلَ الْمَدِينَةِ، وَلاَ يُمْطِرُ أَهْلَ الْمَدِينَةِ.
also referenced under: Book 80, Hadith 39 (In-Book) & Volume 8, Book 75, Hadith 353 (USC-MSA)