كتاب الإمامة
10  
The Book of Leading the Prayer (Al-Imamah)
(2)
Chapter: Praying with tyrannical leaders
(2)
باب الصَّلاَةِ مَعَ أَئِمَّةِ الْجَوْرِ
Sunan an-Nasa'i 779
It was narrated that 'Abdullih said:
"The Messenger of Allah (ﷺ) said: 'You may live to meet people who will be offering the prayer outside its (prayer) time. If you meet them, then offer the prayer on time, then pray with them and make that a voluntary prayer."'
أَخْبَرَنَا عُبَيْدُ اللَّهِ بْنُ سَعِيدٍ، قَالَ حَدَّثَنَا أَبُو بَكْرِ بْنُ عَيَّاشٍ، عَنْ عَاصِمٍ، عَنْ زِرٍّ، عَنْ عَبْدِ اللَّهِ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ لَعَلَّكُمْ سَتُدْرِكُونَ أَقْوَامًا يُصَلُّونَ الصَّلاَةَ لِغَيْرِ وَقْتِهَا فَإِنْ أَدْرَكْتُمُوهُمْ فَصَلُّوا الصَّلاَةَ لِوَقْتِهَا وَصَلُّوا مَعَهُمْ وَاجْعَلُوهَا سُبْحَةً ‏"‏ ‏.‏
Grade: Sahih (Darussalam)
Reference : Sunan an-Nasa'i 779
In-book reference : Book 10, Hadith 3
English translation : Vol. 1, Book 10, Hadith 780