The Book of Prayers (Kitab Al-Salat)
Muslim :: Book 4 : Hadith 1831
Abu Salama b. 'Abd al-Rahman reported that Jabir told him that he had observed the prayer in danger with the Messenger of Allah (may peace be upon him). The Messenger of Allah (may peace be upon him) (first) led one of the two groups in two rak'ah of prayer. and then led the second group in two rak'ah of prayer. So the Messenger of Allah (may peace be upon him) observed four rak'ah and led in two rak'ah each of the groups.