Umar bin Khattab was laid out on his bed, and the people gathered around him, supplicating, praising him, and praying for him before he was lifted up. I was among them.Nothing startled me except a man who took hold of my shoulder from behind. I turned to him, and it was Ali. He invoked Allah's mercy upon Umar and 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, because I often heard the Messenger of Allah ﷺ say, 'Abu Bakr, Umar, and I came. Abu Bakr, Umar, and I entered. Abu Bakr, Umar, and I went out.' So I had hoped, or thought, that Allah would place you with them."
وضع عمر بن الخطاب على سريره، فتكنفه الناس يدعون ويثنون ويصلون عليه قبل أن يرفع، وأنا فيهم، قال: فلم يرعني إلا برجل قد أخذ بمنكبي من ورائي، فالتفت إليه فإذا هو علي، فترحم على عمر وقال: ما خلفت أحدا أحب إلي، أن ألقى الله بمثل عمله منك، وأيم الله إن كنت لأظن أن يجعلك الله مع صاحبيك، وذاك أني كنت أكثر أسمع رسول الله ﷺ يقول: جئت أنا وأبوبكر وعمر، ودخلت أنا وأبو بكر وعمر وخرجت أنا وأبو بكر وعمر. فإن كنت لأرجو، أو لأظن أن يجعلك الله معهما.
Bukhari narrated it in the Virtues of the Companions (3685), and Muslim in the Virtues of the Companions (2389), both through routes from Abdullah bin Mubarak, who said, Umar bin Saeed narrated to us, from Ibn Abu Mulayka, who said, I heard Ibn Abbas say, and then he related it. This wording belongs to Muslim, and Bukhari related it with similar meaning. In one wording of Bukhari, "Then a man behind me placed his elbow on my shoulder, saying, 'May Allah have mercy on you.'" Bukhari narrated it in the Virtues of the Companions (3677) through another route, from Umar bin Saeed bin Abu Husayn Makki, from Ibn Abu Mulayka, and then he related it.