The people of Madinah were struck by a drought during the time of the Messenger of Allah ﷺ. While he was delivering the Friday sermon, a man stood up and said, "Messenger of Allah, the horses have perished and the sheep have perished. Pray to Allah to give us rain."So he stretched out his hands and supplicated.Anas said, "The sky was as clear as glass. Then a wind stirred up and raised clouds, which gathered together, and the sky released its torrents. We went out wading through water until we reached our homes, and the rain did not stop until the following Friday."Then that same man, or another, stood up and said, "Messenger of Allah, the houses have collapsed. Pray to Allah to hold it back."He smiled and said, "Around us, not upon us."I looked at the clouds and saw them splitting away from Madinah as though forming a crown around it.
أصاب أهل المدينة قحط على عهد رسول الله ﷺ فبينا هو يخطب يوم جمعة، إذ قام رجل فقال: يا رسول الله! هلكت الكراع، و هلكت الشاء، فادع الله يسقينا فمد يديه، ودعا. قال أنس: وإن السماء لمثل الزجاجة، فهاجت ريح أنشأت سحابا، ثم اجتمع، ثم أرسلت السماء عزاليها فخرجنا نخوض الماء، حتى أتينا منازلنا، فلم نزل نمطر إلى الجمعة الأخرى، فقام إليه ذلك الرجل أو غيره فقال: يا رسول الله! تهدمت البيوت، فادع الله يحبسه، فتبسم ثم قال: حوالينا ولا علينا فنظرت إلى السحاب تصدع حول المدينة كأنه إكليل.
Bukhari narrated it in the Book of Virtues (3582) and Muslim in the Book of the Prayer for Rain (897), both from the hadith of Thabit Bunani, from Anas, and he related it. The wording given here is Bukhari's, while Muslim narrated it in an abridged form.