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

It was narrated from Abu Bakrah that: The Prophet (PBUH) offered the fear prayer with those who were behind him, praying two rak'ahs (with them) and two rak'ahs with those who came after them, so the Prophet (PBUH) prayed four rak'ahs and the others each prayed two rak'ahs. Translation Not Available

Book Ref: Sunan An Nisai Book 18 Hadith 1555
Web Ref:  Sunan An Nisai Vol 2 Book 18 Hadith 1556