I heard the Messenger of Allah ﷺ delivering a sermon in Medina. He said, "People, Allah the Exalted has hinted regarding wine, and perhaps Allah will soon send down a ruling about it. So whoever has any of it should sell it and benefit from it."He said, We waited only a short while before the Prophet ﷺ said, "Allah the Exalted has forbidden wine. Whoever this verse reaches while he has any of it should neither drink it nor sell it."He said, So the people brought out what they had of it in the streets of Medina and poured it away.
سمعت رسول الله ﷺ يخطب بالمدينة قال: يا أيها الناس، إن الله تعالى يعرض بالخمر، ولعل الله سينزل فيها أمرا، فمن كان عنده منها شيء فليبعه، ولينتفع به. قال: فما لبثنا إلا يسيرا حتى قال النبي ﷺ إن الله تعالى حرم الخمر، فمن أدركته هذه الآية، وعنده منها شيء فلا يشرب ولا يبع. قال: فاستقبل الناس بما كان عندهم منها في طريق المدينة، فسفكوها.
Muslim narrated it in the Book of Musaqah (1578), from Ubaydullah bin Umar Qawariri, who said, Abdul-Ala bin Abdul-Ala Abu Hammam narrated to us, who said, Saeed Jariri narrated to us, from Abu Nadra, from Abu Saeed Khudri, who said, and he mentioned it.His saying, "alluding to wine," means alluding to its prohibition. Allusion is the opposite of an explicit statement. This is what the Prophet ﷺ understood from Allah's saying, "They ask you about wine and gambling. Say, 'In both is great sin and some benefit for people, but their sin is greater than their benefit'" [Baqarah 2:219], and from Allah's saying, "O you who believe, do not approach prayer while you are intoxicated until you know what you are saying" [Nisa 4:43]. That is because when he heard that there was great sin in both, that their sin was greater than their benefit, and that prayer was forbidden while intoxicated, it became clear to him that this fit with prohibition, so he anticipated it.His saying, "so whoever has any of it..." indicates that wine and its sale had been permissible, something the Prophet ﷺ had received from the law that came before him, such as Christianity, even though Isa had not made them permissible, but the scholars of the Christians had permitted them.His saying, "We did not wait long before the Prophet ﷺ said, 'Allah has forbidden wine, so whoever this verse reaches while he still has some of it should neither drink it nor sell it,'" by "the verse" he means Allah's saying, "O you who believe, wine, gambling, idols, and divining arrows are but defilement from the work of Satan, so avoid them that you may succeed" [Maidah 5:90].The Companions understood from his prohibition of drinking and selling it that no benefit whatsoever could be derived from it, so it is not permissible to turn it into vinegar, as the majority of scholars have said, including Malik, Shafii, Ahmad, and others.As for using it for medical treatment, this is a matter of disagreement when there is no other remedy available, and likewise drinking it in cases of severe thirst when no water can be found.