Sahih al-Bukhari, Book 67, Hadith 54 (In-Book)

Narrated Jabir bin `Abdullah and Salama bin Al-Akwa`: While we were in an army, Allah's Messenger came to us and said, "You have been allowed to do the Mut'a (marriage), so do it."

حَدَّثَنَا عَلِيٌّ، حَدَّثَنَا سُفْيَانُ، قَالَ عَمْرٌو عَنِ الْحَسَنِ بْنِ مُحَمَّدٍ، عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ، وَسَلَمَةَ بْنِ الأَكْوَعِ، قَالاَ كُنَّا فِي جَيْشٍ فَأَتَانَا رَسُولُ اللَّهِ صلى الله عليه وسلم فَقَالَ ‏ "‏ إِنَّهُ قَدْ أُذِنَ لَكُمْ أَنْ تَسْتَمْتِعُوا فَاسْتَمْتِعُوا ‏" ‏‏.‏

sunnah.com