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

837. It was narrated from Abu Bakr that the Prophet (PBUH) offered the fear prayer (Salat Al-Khauf). He led those who were behind him in two Rak'ah and those who came (after them) in two Rak'ah, so the Prophet (PBUH) prayed four Rak'ahs and each group prayed two. Translation Not Available

Book Ref: Sunan An Nisai Book 10 Hadith 836
Web Ref:  Sunan An Nisai Vol 1 Book 10 Hadith 837