When Umar was placed upon his bier, the people gathered around him, supplicating and praying for him, or he said, praising him and praying for him, before he was lifted up, and I was among them. Nothing startled me except a man who pressed against me and took hold of my shoulder. I turned, and there was Ali bin Abu Talib. He invoked Allah's mercy upon Umar, then said, "You have left behind no one whose deeds I would rather meet Allah with than yours. By Allah, I always thought that Allah would place you with your two companions, for I often used to hear the Messenger of Allah ﷺ say, 'Abu Bakr, Umar, and I went,' and 'Abu Bakr, Umar, and I entered,' and 'Abu Bakr, Umar, and I came out.' So I always thought that Allah would place you with your two companions."
حدثنا علي بن محمد حدثنا يحيى بن آدم حدثنا ابن المبارك عن عمر بن سعيد بن أبي حسين عن ابن أبي مليكة قال سمعت
لما وضع عمر على سريره اكتنفه الناس يدعون ويصلون أو قال يثنون ويصلون عليه قبل أن يرفع وأنا فيهم فلم يرعني إلا رجل قد زحمني وأخذ بمنكبي فالتفت فإذا علي بن أبي طالب فترحم على عمر ثم قال ما خلفت أحدا أحب إلي أن ألقى الله بمثل عمله منك وايم الله إن كنت لأظن ليجعلنك الله عز وجل مع صاحبيك وذلك أني كنت أكثر أن أسمع رسول الله ﷺ يقول ذهبت أنا وأبو بكر وعمر ودخلت أنا وأبو بكر وعمر وخرجت أنا وأبو بكر وعمر فكنت أظن ليجعلنك الله مع صاحبيك
Bukhari transmitted it in "Virtues," chapter "The Virtues of Umar bin Khattab," etc., no. 3685, and Muslim in "Virtues of the Companions," chapter "The Virtues of Umar" , no. 2389, from the hadith of Ibn Mubarak, with this wording.