When Messenger of Allah ﷺ arrived at Medina, he alighted at the upper part of Medina among the people called Bani ʿAmr bin ʿAuf and he stayed with them for fourteen nights. Then he sent for the chiefs of Bani An-Najjar, and they came, carrying their swords. As if I am just now looking at Messenger of Allah ﷺ on his she-camel with Abu Bakr riding behind him (on the same camel) and the chiefs of Bani An- Najjar around him till he dismounted in the courtyard of Abu Aiyub's home. The Prophet ﷺ used to offer the prayer wherever the prayer was due, and he would pray even in sheepfolds. Then he ordered that the mosque be built. He sent for the chiefs of Banu An-Najjar, and when they came, he said, "O Banu An-Najjar! Suggest to me the price of this garden of yours." They replied "No! By Allah, we do not demand its price except from Allah." In that garden there were the (following) things that I will tell you: Graves of pagans, unleveled land with holes and pits etc., and date-palm trees. Messenger of Allah ﷺ ordered that the graves of the pagans be dug up and, the unleveled land be leveled and the date-palm trees be cut down. The trunks of the trees were arranged so as to form the wall facing the Qibla. The Stone pillars were built at the sides of its gate. The companions of the Prophet ﷺ were carrying the stones and reciting some lyrics, and Messenger of Allah ﷺ . . was with them and they were saying, "O Allah! There is no good Excel the good of the Hereafter, so bestow victory on the Ansar and the Emigrants. " (Using translation from Bukhārī 3932)
لَمَّا قَدِمَ رَسُولُ اللهِ ﷺ الْمَدِينَةَ نَزَلَ فِي عُلُوِّ الْمَدِينَةِ فِي حَيٍّ يُقَالُ لَهُ بَنُو عَمْرِو بْنِ عَوْفٍ فَأَقَامَ فِيهِمْ أَرْبَعَ عَشْرَةَ لَيْلَةً ثُمَّ إِنَّهُ أَرْسَلَ إِلَى مَلَأِ بَنِي النَّجَّارِ قَالَ فَجَاءُوا مُتَقَلِّدِينَ سُيُوفَهُمْ قَالَ فَكَأَنِّي أَنْظُرُ إِلَى رَسُولِ اللهِ ﷺ عَلَى رَاحِلَتِهِ وَأَبُو بَكْرٍ رِدْفُهُ وَمَلَأُ بَنِي النَّجَّارِ حَوْلَهُ حَتَّى أَلْقَى بِفِنَاءِ أَبِي أَيُّوبَ قَالَ فَكَانَ يُصَلِّي حَيْثُ أَدْرَكَتْهُ الصَّلَاةُ وَيُصَلِّي فِي مَرَابِضِ الْغَنَمِ ثُمَّ إِنَّهُ أَمَرَ بِالْمَسْجِدِ فَأَرْسَلَ إِلَى مَلَأِ بَنِي النَّجَّارِ فَجَاءُوا فَقَالَ يَا بَنِي النَّجَّارِ ثَامِنُونِي حَائِطَكُمْ هَذَا؟ قَالُوا لَا وَاللهِ لَا نَطْلُبُ ثَمَنَهُ إِلَّا إِلَى اللهِ قَالَ وَكَانَ فِيهِ مَا أَقُولُ لَكُمْ كَانَتْ فِيهِ قُبُورُ الْمُشْرِكِينَ وَكَانَ فِيهِ خِرَبٌ وَكَانَ فِيهِ نَخْلٌ فَأَمَرَ رَسُولُ اللهِ ﷺ بِقُبُورِالْمُشْرِكِينَ فَنُبِشَتْ وَبِالْخِرَبِ فَسُوِّيَتْ وَبِالنَّخْلِ فَقُطِعَ قَالَ فَصَفُّوا النَّخْلَ إِلَى قِبْلَةِ الْمَسْجِدِ وَجَعَلُوا عِضَادَتَيْهِ حِجَارَةً قَالَ وَجَعَلُوا يَنْقُلُونَ ذَلِكَ الصَّخْرَ وَهُمْ يَرْتَجِزُونَ وَرَسُولُ اللهِ ﷺ مَعَهُمْ يَقُولُ اللهُمَّ إِنَّهُ لَا خَيْرَ إِلَّا خَيْرُ الْآخِرَهْ فَانْصُرِ الْأَنْصَارَ وَالْمُهَاجِرَهْ