Sayyiduna Anas bin Malik (may Allah be pleased with him) says that the Prophet (peace and blessings be upon him) mounted a horse and fell, and his right side (peace and blessings be upon him) was injured. He (peace and blessings be upon him) led one of the prayers sitting, so we too prayed sitting behind him (peace and blessings be upon him). When he (peace and blessings be upon him) finished the prayer, he said: "The imam is appointed only to be followed. When he prays standing, you too pray standing; when he bows, you too bow; when he rises, you too rise; when he says 'Sami'a Allahu liman hamidah' (Allah hears the one who praises Him), you say 'Rabbana wa lakal-hamd' (Our Lord, and to You belongs all praise); and when he prays sitting, then all of you pray sitting."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5070