It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) mounted a horse and fell from it, and his (peace and blessings be upon him) blessed right side was grazed. He (peace and blessings be upon him) led us in one of the prayers sitting, and we too prayed behind him (peace and blessings be upon him) sitting. When he (peace and blessings be upon him) finished the prayer, he said: "The imam is appointed only to be followed. Do not differ from the imam. When he leads the prayer standing, pray standing; when he says the takbir, say the takbir; when he says 'Sami'allahu liman hamidah' (Allah has heard the one who praised Him), say 'Rabbana wa lakal-hamd' (Our Lord, and to You belongs all praise); when he prostrates, prostrate; and when the imam leads the prayer sitting, pray sitting."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2619