The founding of the Prophet's Mosque
After the Prophet ﷺ entered Madinah, his she-camel knelt at a drying-yard belonging to two orphan boys. He ﷺ bought it and built there his noble mosque and living quarters, working in its construction with his own hands alongside his Companions.
When the Prophet ﷺ entered Madinah, the Ansar took hold of his she-camel's rein, each wanting him as a guest, so he said: "Leave her, for she is commanded," until she knelt at a drying-yard belonging to Sahl and Suhayl, two orphan boys of Banu al-Najjar. He bought it from them and stayed with Abu Ayyub al-Ansari until the building was complete.
The mosque was built of mud-brick, its roof of palm branches and its pillars of palm trunks. He ﷺ worked in it himself, carrying the bricks with his Companions as they chanted: "O Allah, there is no life but the life of the Hereafter; so forgive the Ansar and the Emigrants."
The Prophet's Mosque became the heart of the new state: prayer, gatherings of revelation and knowledge, the tying of banners and the receiving of delegations. He ﷺ said: "A prayer in this mosque of mine is better than a thousand prayers elsewhere, except the Sacred Mosque."
Note — differing reports on the date: Construction began after his ﷺ arrival in Madinah in Rabiʿ al-Awwal of year 1; the sources do not fix the exact day it began.