حَدَّثَنَا أَبُو الْيَمَانِ، قَالَ أَخْبَرَنَا شُعَيْبٌ، عَنِ الزُّهْرِيِّ، قَالَ أَخْبَرَنِي أَنَسُ بْنُ مَالِكٍ الأَنْصَارِيُّ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم رَكِبَ فَرَسًا، فَجُحِشَ شِقُّهُ الأَيْمَنُ، قَالَ أَنَسٌ ـ رضى الله عنه ـ فَصَلَّى لَنَا يَوْمَئِذٍ صَلاَةً مِنَ الصَّلَوَاتِ وَهْوَ قَاعِدٌ، فَصَلَّيْنَا وَرَاءَهُ قُعُودًا، ثُمَّ قَالَ لَمَّا سَلَّمَ ‏"‏ إِنَّمَا جُعِلَ الإِمَامُ لِيُؤْتَمَّ بِهِ، فَإِذَا صَلَّى قَائِمًا فَصَلُّوا قِيَامًا، وَإِذَا رَكَعَ فَارْكَعُوا، وَإِذَا رَفَعَ فَارْفَعُوا، وَإِذَا سَجَدَ فَاسْجُدُوا وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ‏.‏ فَقُولُوا رَبَّنَا وَلَكَ الْحَمْدُ ‏"‏‏.‏
Translation
Narrated Anas bin Malik

Allah's Messenger (ﷺ) fell from a horse and got injured so he led the prayer sitting and we also prayed sitting. When he completed the prayer he said, "The Imam is to be followed; if he says Takbir then say Takbir, bow if he bows; raise your heads when he raises his head, when he says, 'Sami`a l-lahu liman hamidah say, 'Rabbana laka l-hamd', and prostrate when he prostrates."