The Messenger of Allah ﷺ said, "This matter will remain with Quraysh as long as two of them remain."
قال رسول الله ﷺ: لا يزال هذا الأمر في قريش ما بقي منهم اثنان.
Bukhari narrated it in the Book of Rulings (7140), and Muslim in the Book of Governance (1820), both from Ahmad bin Abdullah bin Yunus, who said, Asim bin Muhammad bin Zayd told us, I heard my father say, Ibn Umar said, and then he mentioned it.This is a report about the greater leadership (al-imamah al-kubra), stating that it belongs only to Quraysh. The greater leadership came to an end with the end of the Abbasid state, and the Islamic state then became scattered and divided into provinces and small states, most of whose rulers were not from Quraysh. Among these rulers were scholars and judges, and we do not find that any of them objected to the rulers of these provinces and small states. So it became a matter of consensus that what is meant by the hadith is the greater leadership, not the provinces and small states.As for matters other than governance, there is no disagreement among the Muslims about giving precedence to a non-Qurayshi over a Qurayshi. The Prophet ﷺ gave precedence to Zayd bin Haritha, his son Usama bin Zayd, and Muaz bin Jabal over Quraysh, just as he gave precedence to Salim, the freed slave of Abu Huzaifa, to lead the prayer at Quba. Salim used to lead them in prayer even though Abu Bakr, Umar, and other nobles of Quraysh were among them.