Hadithcore
Sahih al-Bukhari, 472
sahih

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.

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

‏ مَثْنَى مَثْنَى، فَإِذَا خَشِيَ الصُّبْحَ صَلَّى وَاحِدَةً، فَأَوْتَرَتْ لَهُ مَا صَلَّى ‏

‏‏.‏ وَإِنَّهُ كَانَ يَقُولُ اجْعَلُوا آخِرَ صَلاَتِكُمْ وِتْرًا، فَإِنَّ النَّبِيَّ صلى الله عليه وسلم أَمَرَ بِهِ‏.‏

References2 variants
In-Book Reference
Book 8, Hadith 120
USC-MSA web (English) reference
Vol. 1, Book 8, Hadith 461 (deprecated numbering scheme)
Sharh · explanationclick to expand
The Sahabah (may Allah be pleased with them) were keen to ask the Prophet (blessings and peace of Allah be upon him) about prayer, both obligatory and supererogatory, which included voluntary prayers at night (qiyam al-layl), after Allah praised His Messenger and the believers for that in His Book: {Indeed, your Lord knows, [O Muhammad], that you stand [in prayer] almost two thirds of the night or half of it or a third of it, and [so do] a group of those with you} [al-Muzzammil 73:20]. In this hadith, ‘Abdullah ibn ‘Umar (may Allah be pleased with him) narrates that a man came to the Prophet (blessings and peace of Allah be upon him) whilst he was addressing the people from his minbar in his mosque. Perhaps he was addressing the people on Friday (Jumu‘ah) or on some other occasion. The man asked him how the prayers at nights were to be done, and the Prophet (blessings and peace of Allah be upon him) told him that they are to be done two by two; in other words: pray two rak‘ahs then say the taslim, then pray two more, and so on, and then when the worshipper fears that the time for Fajr prayer is about to begin – and the same applies to one who prays at the beginning of the night then sleeps until the time of Fajr – he should end his qiyam with a single rak‘ah, so as to make the even-numbered prayers that he has offered odd-numbered, then say the taslim after that. Then Ibn ‘Umar (may Allah be pleased with him) instructed his companions to make the last of their prayers before sleeping, or before the break of dawn, odd-numbered, because the Prophet (blessings and peace of Allah be upon him) enjoined that. The Prophet (blessings and peace of Allah be upon him) prayed Witr in different ways, with different numbers of rak‘ahs. By examining all of the reports, it becomes clear that it is permissible to pray Witr with three, five, seven, nine or eleven rak‘ahs. If a person prays Witr with three rak‘ahs, there are two ways of doing that which are both prescribed. The first is to offer three rak‘ahs one after another with one tashahhud; the second way is to say the taslim after two rak‘ahs then offer one rak‘ah on its own. But if he prays Witr with five or seven rak‘ahs, then they should be done continuously, with no tashahhud except one tashahhud at the end, followed by the taslim. If he prays Witr with nine rak‘ahs, they should be done continuously, and he should sit for the tashahhud in the eighth rak‘ah, then stand up without saying the taslim, and recite tashahhud in the ninth, followed by the taslim. If he prays Witr with eleven rak‘ahs, he should say the taslim after each two rak‘ahs, then pray one rak‘ah on its own at the end. The least perfect way of praying Witr is to pray two rak‘ahs and say the taslim, then to pray one rak‘ah on its own, then say the taslim. It is permissible to pray Witr with one taslim, but that should be with one tashahhud, not two..
Related hadiths12
Compare isnād across 12 related chains →