[Machine] The night prayer of the Messenger of Allah ﷺ was said to be thirteen rak'ahs. Then it was mentioned that he prayed eleven rak'ahs and left two rak'ahs. Then, when he was taken (passed away), he was praying nine rak'ahs in the night prayer. The last prayer he prayed at night was the Witr prayer. Muhammad bin Ishaq bin Khuzaimah differed with Muhmal bin Hisham on this matter. Abu Ishaq narrated from Masrooq and the narration of Abu Dawood is the most authentic based on the evidence of what was mentioned from the narration of Ammar bin Ruzayq.
صَلَاةِ رَسُولِ اللهِ ﷺ بِاللَّيْلِ فَقَالَتْ كَانَ يُصَلِّي ثَلَاثَ عَشْرَةَ رَكْعَةً مِنَ اللَّيْلِ ثُمَّ إِنَّهُ صَلَّى إِحْدَى عَشْرَةَ رَكْعَةً وَتَرَكَ رَكْعَتَيْنِ ثُمَّ قُبِضَ حِينَ قُبِضَ وَهُوَ يُصَلِّي مِنَ اللَّيْلِ تِسْعَ رَكَعَاتٍ آخِرُ صَلَاتِهِ مِنَ اللَّيْلِ الْوِتْرُ خَالَفَهُ مُحَمَّدُ بْنُ إِسْحَاقَ بْنِ خُزَيْمَةَ عَنْ مُؤَمَّلِ بْنِ هِشَامٍ فَقَالَ عَنْ أَبِي إِسْحَاقَ عَنْ مَسْرُوقٍ وَرِوَايَةُ أَبِي دَاوُدَ أَصَحُّ بِدَلِيلِ مَا تَقَدَّمَ مِنْ رِوَايَةِ عَمَّارِ بْنِ رُزَيْقٍ