He was with the Messenger of Allah ﷺ when he said, "People, I had previously permitted you to engage in temporary marriage with women. Allah has now forbidden that until the Day of Resurrection. Whoever has any of these women with him should let her go, and do not take back anything you have given them."In another wording, "I saw the Messenger of Allah ﷺ standing between the Corner and the Door, saying," and he then mentioned the same.
أنه كان مع رسول الله ﷺ فقال: يا أيها الناس، إني قد كنت أذنت لكم في الاستمتاع من النساء. وإن الله قد حرم ذلك إلى يوم القيامة، فمن كان عنده منهن شيء فليخل سبيله، ولا تأخذوا مما آتيتموهن شيئا. وفي لفظ: رأيت رسول الله ﷺ قائما بين الركن والباب، وهو يقول: فذكره.
Muslim narrated it in the Book of Marriage (21:1406) from Muhammad bin Abdullah bin Numayr, who said, my father narrated to us, who said, Abdul-Aziz bin Umar narrated to us, who said, Rabi bin Sabra Juhani narrated to me that his father told him, and he related it.The hadith of Sabra Juhani has other chains of transmission in Muslim and elsewhere, and the summary of it is that mutah marriage was permitted during the year of the Conquest for a few days, then the prohibition came to last forever. This is what a group of the companions of Rabi bin Sabra Juhani relate.Abdul-Aziz bin Umar bin Abdul-Aziz differed from them and placed it during the Farewell Pilgrimage, as narrated by Ibn Majah (1962), Ahmad (15345), Ibn Hibban (4147), and Bayhaqi (7/203). Bayhaqi held that the error belongs to Abdul-Aziz bin Umar, since he contradicted the report of the majority from Rabi bin Sabra that it occurred at the time of the Conquest.I say, it is as he said, for Abdul-Aziz bin Umar bin Abdul-Aziz Umawi was described as one who used to make mistakes, and this is one of his mistakes. Muslim took note of this, so he presented the hadith through his chain (21:1406) but did not quote its wording in full, just as he did not mention the time period in which this hadith occurred, whereas he had mentioned both before and after it that it was at the time of the Conquest.