Sayyiduna Ali (may Allah be pleased with him) said: The Prophet (peace and blessings be upon him), while addressing the people, said: "Beware! The rulers will be from Quraysh. Beware! The rulers will be from Quraysh. Beware! The rulers will be from Quraysh, as long as they do three things: when they judge, they act with justice; when they make a covenant, they fulfil it; and when mercy is sought from them, they show mercy. Whoever among them does not do so, upon him will be the curse of Allah Almighty, the angels and all mankind."
Abu Ya'la recorded it; its chain contains narrators whom I do not know.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الخلافة / 8975