Sahih al-Bukhari, Hadith 4187

`Abdullah bin `Umar added: "The people were along with the Prophet on the day of Al-Hudaibiya spreading in the shade of the trees. Suddenly the people surrounded the Prophet and started looking at him." `Umar said, "O `Abdullah! Go and see why the people are encircling Allah's Apostle and looking at him." `Abdullah bin `Umar then saw the people giving the Pledge o allegiance to the Prophet. So he also gave the Pledge of allegiance and returned to `Umar who went out in his turn and gave the Pledge of allegiance to the Prophet.'

وَقَالَ هِشَامُ بْنُ عَمَّارٍ حَدَّثَنَا الْوَلِيدُ بْنُ مُسْلِمٍ، حَدَّثَنَا عُمَرُ بْنُ مُحَمَّدٍ الْعُمَرِيُّ، أَخْبَرَنِي نَافِعٌ، عَنِ ابْنِ عُمَرَ ـ رضى الله عنهما ـ أَنَّ النَّاسَ، كَانُوا مَعَ النَّبِيِّ صلى الله عليه وسلم يَوْمَ الْحُدَيْبِيَةِ، تَفَرَّقُوا فِي ظِلاَلِ الشَّجَرِ، فَإِذَا النَّاسُ مُحْدِقُونَ بِالنَّبِيِّ صلى الله عليه وسلم فَقَالَ يَا عَبْدَ اللَّهِ، انْظُرْ مَا شَأْنُ النَّاسِ قَدْ أَحْدَقُوا بِرَسُولِ اللَّهِ صلى الله عليه وسلم فَوَجَدَهُمْ يُبَايِعُونَ، فَبَايَعَ ثُمَّ رَجَعَ إِلَى عُمَرَ فَخَرَجَ فَبَايَعَ‏.‏

sunnah.com