[Machine] Abu Bakr was with the Messenger of Allah ﷺ when someone said to him, "O companion of the Messenger of Allah, the Messenger of Allah has passed away?" He replied, "Yes, he has. So you should know that just as he said, 'Abu Bakr (will lead you).' Then Abu Bakr went apart from you to attend to the washing of the Messenger of Allah ﷺ for his death. Then the Muhajirun gathered together and consulted each other. While they were in that consultation, they said, 'Let us go to our brothers from the Ansar, for they have a share in this matter'. So they went and approached the Ansar, and one of the Ansar said, 'There is one person among us and one person among you.' 'Umar bin al-Khattab took Abu Bakr's hand and said, 'Who is he who has this (verse), "When they both were in the Cave"? (9:40) Who is his companion, "When he said to his companion"? (9:40) Who is the one with him, "Do not grieve; indeed Allah is with us"? (9:40) Then 'Umar extended the hand of Abu Bakr and said, 'People, pledge allegiance to him.' So the people pledged allegiance to Abu Bakr, the best and most beautiful pledge of allegiance."
أَبُو بَكْرٍ ؓ عِنْدَ رَسُولِ اللهِ ﷺ فَقِيلَ لَهُ يَا صَاحِبَ رَسُولِ اللهِ تُوُفِّيَ رَسُولُ اللهِ ﷺ؟ فَقَالَ نَعَمْ فَعَلِمُوا أَنَّهُ كَمَا قَالَ ثُمَّ قَالَ أَبُو بَكْرٍ ؓ دُونَكُمْ صَاحِبَكُمْ لِبَنِي عَمِّ رَسُولِ اللهِ ﷺ يَعْنِي فِي غُسْلِهِ يَكُونُ أَمْرُهُ ثُمَّ خَرَجَ فَاجْتَمَعَ الْمُهَاجِرُونَ يَتَشَاوَرُونَ فَبَيْنَا هُمْ كَذَلِكَ يَتَشَاوَرُونَ إِذْ قَالُوا انْطَلِقُوا بِنَا إِلَى إِخْوَانِنَا مِنَ الْأَنْصَارِ فَإِنَّ لَهُمْ فِي هَذَا الْحَقِّ نَصِيبًا فَانْطَلَقُوا فَأَتَوُا الْأَنْصَارَ فَقَالَ رَجُلٌ مِنَ الْأَنْصَارِ مِنَّا رَجُلٌ وَمِنْكُمْ رَجُلٌ فَقَالَ عُمَرُ بْنُ الْخَطَّابِ ؓ سَيْفَانِ فِي غِمْدٍ وَاحِدٍ إِذًا لَا يَصْطَلِحَا فَأَخَذَ بِيَدِ أَبِي بَكْرٍ ؓ وَقَالَ مَنْ هَذَا الَّذِي لَهُ هَذِهِ الثَّلَاثُ {إِذْ هُمَا فِي الْغَارِ} [التوبة 40] مَنْ هُمَا؟ {إِذْ يَقُولُ لِصَاحِبِهِ} [التوبة 40] مَنْ صَاحِبُهُ؟ {لَا تَحْزَنْ إِنَّ اللهَ مَعَنَا} [التوبة 40] مَعَ مَنْ هُوَ؟ فَبَسَطَ عُمَرُ يَدَ أَبِي بَكْرٍ ؓ فَقَالَ بَايَعُوهُ فَبَايَعَ النَّاسُ أَحْسَنَ بَيْعَةٍ وَأَجْمَلَهَا