Sayyiduna Ibn Umar (may Allah be pleased with them both) narrates that he was sitting with the Prophet (peace and blessings be upon him) along with some of the Companions, when the Prophet (peace and blessings be upon him) said: "O people, do you not know that I am the Messenger of Allah?" They said: Of course, we bear witness that you are the Messenger of Allah. He (peace and blessings be upon him) said: "Do you not know that Allah revealed in His Book: Whoever obeys me has obeyed Allah?" They said: Of course, we bear witness that whoever obeys you has obeyed Allah, and that obeying you is part of obeying Allah. He (peace and blessings be upon him) said: "And obeying Allah is that you obey me, and part of obeying me is that you obey your imams; and if they lead the prayer sitting, then all of you pray sitting."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 13181