Language:
كتاب الصلاة
8  
Prayers (Salat)
(84)
Chapter: The religious gathering in circles and sitting in the mosque
(84)
باب الْحِلَقِ وَالْجُلُوسِ فِي الْمَسْجِدِ
Sahih al-Bukhari 472

Narrated Nafi`:

Ibn `Umar said, "While the Prophet (ﷺ) was on the pulpit, a man asked him how to offer the night prayers. He replied, 'Pray two rak`at at a time and then two and then two and so on, and if you are afraid of the dawn (the approach of the time of the Fajr prayer) pray one rak`a and that will be the witr for all the rak`at which you have offered." Ibn `Umar said, "The last rak`at of the night prayer should be odd, for the Prophet (ﷺ) ordered it to be so.

حَدَّثَنَا مُسَدَّدٌ، قَالَ حَدَّثَنَا بِشْرُ بْنُ الْمُفَضَّلِ، عَنْ عُبَيْدِ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ سَأَلَ رَجُلٌ النَّبِيَّ صلى الله عليه وسلم وَهْوَ عَلَى الْمِنْبَرِ مَا تَرَى فِي صَلاَةِ اللَّيْلِ قَالَ ‏ "‏ مَثْنَى مَثْنَى، فَإِذَا خَشِيَ الصُّبْحَ صَلَّى وَاحِدَةً، فَأَوْتَرَتْ لَهُ مَا صَلَّى ‏"‏‏.‏ وَإِنَّهُ كَانَ يَقُولُ اجْعَلُوا آخِرَ صَلاَتِكُمْ وِتْرًا، فَإِنَّ النَّبِيَّ صلى الله عليه وسلم أَمَرَ بِهِ‏.‏
Reference : Sahih al-Bukhari 472
In-book reference : Book 8, Hadith 120
USC-MSA web (English) reference : Vol. 1, Book 8, Hadith 461
  (deprecated numbering scheme)