Traced to Ka'b al-Ahbar (automatic guess): a report of earlier scriptures, not a hadith of the Prophet ﷺ.
إذا كثر الهرج في الناس قال الناس: إنما هذا القتال في قريش ولها، فاقتلوهم حتى تستريحوا، فيقتلونهم حتى لا يبقى منهم أحد، ويغزو الناس بعضهم بعضا كما كانوا في جاهليتهم، ويملك الناس رجل من الموالي
If there is a lot of commotion among the people, the people will say: This fighting is for the Quraysh and theirs, so kill them until you are at peace. They will kill them until not a single one of them remains, and the people will attack each other as they were in their pre-Islamic era, and the people will be ruled by a man of the loyal ones.
رشدينابن لهيعةأبي زرعةتبيعكعبautomatic reading, unverified