[Machine] The Messenger of Allah ﷺ arrived in Madinah as the first thing he did when he arrived, 'Ammar ibn Yasir said, "The Messenger of Allah ﷺ should have a place for him to rest in and pray when he wakes up from his sleep." So, 'Ammar gathered stones and built the Quba Mosque, which was the first mosque to be built, and 'Ammar was the one who built it.
قَدِمَ رَسُولُ اللَّهِ ﷺ الْمَدِينَةَ أَوَّلَ مَا قَدِمَهَا فَقَالَ عَمَّارُ بْنُ يَاسِرٍ «مَا لِرَسُولِ اللَّهِ ﷺ بُدٌّ مِنْ أَنْ نَجْعَلَ لَهُ مَكَانًا إِذَا اسْتَيْقَظَ مِنْ قَائِلَتِهِ اسْتَظَلَّ فِيهِ وَصَلَّى فِيهِ» فَجَمَعَ عَمَّارٌ حِجَارَةً فَسَوَّى مَسْجِدَ قُبَاءَ فَهُوَ أَوَّلُ مَسْجِدٍ بُنِيَ وَعَمَّارٌ بَنَاهُ