Sayyidah Aishah (may Allah be pleased with her) says that the Messenger of Allah (peace and blessings be upon him) prayed sitting in his house, and some people began praying behind him (peace and blessings be upon him) standing. He (peace and blessings be upon him) gestured to them: "Sit down as well." When he (peace and blessings be upon him) finished the prayer, he said: "The imam is appointed only to be followed. When he bows, you bow; when he raises his head, you too raise your heads; and when he prays sitting, you too pray sitting." In the narration of al-Shafi'i: He (peace and blessings be upon him) was ill, so he prayed sitting.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5071