I heard the Messenger of Allah ﷺ say, "Whoever Allah intends good for, He gives him understanding of the religion. This nation will continue to stand firm upon the command of Allah, and those who oppose them will not harm them, until the command of Allah comes while they remain victorious over the people."
حدثنا أبو سلمة الخزاعي أخبرنا ليث يعني ابن سعد عن يزيد بن الهاد عن عبد الوهاب بن أبي بكر عن ابن شهاب عن حميد بن عبد الرحمن
سمعت رسول الله ﷺ يقول من يرد الله به خيرا يفقه في الدين ولن تزال هذه الأمة أمة قائمة على أمر الله لا يضرهم من خالفهم حتى يأتي أمر الله وهم ظاهرون على الناس
Its isnad is sahih. Abdul-Rahman bin Humayd bin Abdul-Rahman bin Awf is trustworthy and well known, and his hadith is found in all six of the major collections. Abdul-Wahhab bin Abu Bakr Madani is trustworthy, and he is the one known as Zuhri's agent. The hadith has already appeared at 16868m2.