It is narrated from Sayyiduna al-Bara' bin Azib and Sayyiduna Zayd bin Arqam (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him), when he intended to go on a military expedition, said to Ali (may Allah be pleased with him): "It is necessary that either you stay (in Madinah) or I stay." So he (peace and blessings be upon him) left him behind (in Madinah). Some people said: "He must have left him behind only for some reason he disliked." This reached Ali (may Allah be pleased with him), so he came to the Messenger of Allah (peace and blessings be upon him) and told him (peace and blessings be upon him). He (peace and blessings be upon him) laughed, then said: "O Ali, are you not pleased that your rank with me should be that which Harun (peace be upon him) had with Musa (peace be upon him), except that there is no prophet after me?"
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 5075