God’s Messenger was reciting as-Sajda (Al-Qur’an; 32) when we were with him. He was prostrating himself and we were doing so along with him, but we were so crowded that none of us could find a place for his forehead when prostrating himself.
We prostrated ourselves along with the Prophet on account of “When the sky is rent asunder”, Al-Qur’an; 84) and “Recite in the name of your Lord” (Al-Qur’an; 96).
Ibn ‘Abbas said that the Prophet prostrated himself when an-Najm (Al-Qur'an; 53) was revealed, and the Muslims, the ploytheists, jinn and men prostrated themselves along with him.