Sayyiduna Abu Kabshah (may Allah be pleased with him) narrates that at the time of the Battle of Tabuk, some people hurried to enter al-Hijr (the dwellings of Thamud). So it was announced among the people that the prayer would be held in congregation. He said: I came to the Messenger of Allah (peace and blessings be upon him) while he (peace and blessings be upon him) was holding his camel and saying: "Why are you entering upon a people with whom Allah was angry?" He said: A man, wondering at them, called out to him (peace and blessings be upon him): O Messenger of Allah! So the Messenger of Allah (peace and blessings be upon him) said: "Shall I not tell you of something more wondrous than that? The Messenger of Allah, from among yourselves, is in your midst; he informs you of what was before you and what will be after you. Remain upright and keep to what is right, for Allah does not care in the least about punishing you."
Hadith Referenceالمعجم الكبير للطبراني / مسند من يعرف بالكنى / 19054