Abu Dharr reported,

My beloved friend instructed me to listen and obey even if the one in authority were a slave with mutilated limbs, and to perform the prayer at its proper time. So if I come upon the people and find they have already prayed, I will have secured my prayer, and if not, it counts as a voluntary prayer for me.

Muslim 1467

Sahih

و حدثنا أبو بكر بن أبي شيبة حدثنا عبد الله بن إدريس عن شعبة عن أبي عمران عن عبد الله بن الصامت

عن أبي ذر قال

إن خليلي أوصاني أن أسمع وأطيع وإن كان عبدا مجدع الأطراف وأن أصلي الصلاة لوقتها فإن أدركت القوم وقد صلوا كنت قد أحرزت صلاتك وإلا كانت لك نافلة

مسلم 1467صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Disliking delaying prayer beyond its preferred time and what the follower should do if the imam delays it
Numbering
Darussalam 1467
Muslim 1467