Sahih Muslim Book 8, Hadith Number 3257.

Chapter: Temporary marriage and its prohibition for all times to come.

‘Abd al-Malik b. Rabi’ b. Sabraal-Juhanni reported on the authority of his father who narrated it on the authority of his father (i.e. ‘Abd al-Malik’s grandfather, Sabura al-juhanni): Allah’s Messenger (May peace be upon him) permitted us to contract temporary marriage in the Year of Victory, as we entered Mecca, and we did come out of it but he forbade us to do it.