Abdullah ibn Mas'ood said:
On the night of the delegation of Jinn (i.e. during the battle of Tabuk), we were with the Prophet, peace be upon him and his progeny, when he made a station at Ula. Then he went away, and when he returned, he heaved a sigh. Then he said: "O Ibn Mas'ood, I have been warned of my impending death." So I said: "O messenger of Allah, appoint a successor." He asked: "Who?" "I said: "Abu Bakr." He said: (The Prophet) walked for sometime, and heaved a sigh and then said: "My death has been announced to me O Ibn Mas'ood."
Then I said: "Appoint a successor, O messenger of Allah." He asked: "Who?" I said: "Umar." He remained silent, and then walked for sometime, heaved a sigh, and said: "I have been given news of my death, O Ibn Mas'ood!" So, I said: "Appoint a successor!" He asked: "Who?" I said: "Uthman." He kept silent, walked for sometime, heaved a sigh and said: "O Ibn Mas'ood, my death has been announced to me!" I said: "Appoint a successor, O Prophet of Allah" He asked: "Who?" I said: "‘Ali ibn Abi Talib." He heaved a sigh and said: "By He Who controls my soul, if they obey him (i.e. ‘Ali), they will definitely enter Paradise, everyone of them."