The Messenger of Allah ﷺ said, "Allah has cursed a people who took the graves of their prophets as places of worship."
حدثنا محمد بن بكر قال حدثنا سعيد عن قتادة عن سعيد بن المسيب
أن رسول الله ﷺ قال لعن الله قوما اتخذوا قبور أنبيائهم مساجد
Its isnad is sahih. It was previously mentioned in 25009.