(Imām Bukhārī narrates): Musaddad narrated to us, he said: Abu Awanah narrated the hadith to us, from Qatadah, from Hazrat Anas (Allāh be pleased with him), he said:
at the time when the Messenger of Allāh ﷺ was delivering the Jumu'ah khutbah, suddenly a man came, he said: "O Messenger of Allāh! Famine of rain has occurred, so pray to Allāh that He send down rain upon us." So he ﷺ supplicated, so rain was sent down upon us, so it was near that we would not reach our houses, so it kept raining continuously until the next Jumu'ah. Then that same man stood, or another man, so he said: "O Messenger of Allāh! Pray to Allāh that He take this rain away from us." The Messenger of Allāh ﷺ supplicated: "O Allāh! Rain around us, not upon us." Hazrat Anas said: So I looked closely and saw the clouds splitting to the right and left as they rained, and it was not raining upon the people of Madinah.
حَدَّثَنَا مُسَدَّدٌ قَالَ حَدَّثَنَا أَبُو عَوَانَةَ عَنْ قَتَادَةَ عَنْ أَنَسِ بْنِ مَالِكٍ قَالَ بَيْنَمَا رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَخْطُبُ يَوْمَ الْجُمُعَةِ إِذْ جَاءَهُ رَجُلٌ فَقَالَ يَا رَسُولَ اللَّهِ قَحَطَ الْمَطَرُ فَادْعُ اللَّهَ أَنْ يَسْقِيَنَا فَدَعَا فَمُطِرْنَا فَمَا كِدْنَا أَنْ نَصِلَ إِلَى مَنَازِلِنَا فَمَا زِلْنَا نُمْطَرُ إِلَى الْجُمُعَةِ الْمُقْبِلَةِ قَالَ فَقَامَ ذَلِكَ الرَّجُلُ أَوْ غَيْرُهُ فَقَالَ يَا رَسُولَ اللَّهِ ادْعُ اللَّهَ أَنْ يَصْرِفَهُ عَنَّا فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ اللَّهُمَّ حَوَالَيْنَا وَلَا عَلَيْنَا قَالَ فَلَقَدْ رَأَيْتُ السَّحَابَ يَتَقَطَّعُ يَمِينًا وَشِمَالًا يُمْطَرُونَ وَلَا يُمْطَرُ أَهْلُ الْمَدِينَةِ
Reference: Sahih Al Bukhari 1015