Then I searched for a person who had deep understanding in religion amongst the people after him. So I came to Ibn Mas'ud and remained in his company until his death. He (Ibn Mas'ud) said: The Messenger of Allah (ﷺ) said to me: How will you act when you are ruled by rulers who say prayer beyond its proper time? I said: What do you command me, Messenger of Allah, if I witness such a time? He replied: Offer the prayer at its proper time and also say your prayer along with them as a supererogatory prayer.
In-book : Book 2, Hadith 42
English translation : Book 2, Hadith 432