[9] In another account, the mosque had been built prior to Muhammad's arrival by the first Muslim emigrants from Mecca and some of the Anṣār of Medina.
[9] Johannes Pedersen supported the story's plausibility, arguing that there are indications in the Qur'an and other traditional sources that other mosques indeed existed and were recognized in Muhammad's time.
[10] During the Mamluk era, Sultan al-Nasir Muhammad ibn Qalawun reconstructed the mosque in 1333, the ceiling was redone under al-Ashraf Barsbay in 1436, and Qaytbay made renovations in 1476.
[7] In 1968 (1388 AH), during the reign of King Faisal bin Abdulaziz, the mosque's exterior walls were refurbished, and the northern portico, facing Medina, was extended to include a dedicated women's entrance.
[13] The present-day mosque is the result of a complete reconstruction that began in 1984 under Saudi king Fahd bin Abdulaziz.
[8] The project aimed to maintain the mosque's traditional Islamic architectural elements while significantly increasing its capacity to accommodate 20,000 worshipers.
A dedicated women's prayer area was established in the northern section, spanning two floors and accommodating approximately 7,000 female worshipers.
[16] On April 8, 2022, Crown Prince Mohammed bin Salman announced the launch of the largest expansion in the history of the Quba Mosque, along with the development of its surrounding area.
[18] In March 2023, the responsibility for overseeing and operating the Quba Mosque was transferred to the Al Madinah Region Development Authority from the Ministry of Islamic Affairs, Dawah, and Guidance.
This is referred to in a number of hadith: Narrated 'Abdullah bin Dinar: Ibn 'Umar said, "The Prophet used to go to the Mosque of Quba every Saturday (sometimes) walking and (sometimes) riding."
[10] For much of its history prior to the 1980s reconstruction, it maintained its generally Umayyad form, with a covered prayer hall and an internal courtyard surrounded by galleries with rows of arches.
It was also decorated with mosaics, probably created with the help of Byzantine craftsmen who also worked on a renovation of the Prophet's Mosque in Medina around the same time.
Prior to its modern reconstruction, the mosque's western entrance was also fronted by a façade with Ottoman tughras (calligraphic signatures) and an inscription recording Mahmud II's works.
The prayer hall connects to a cluster containing residential areas, offices, ablution facilities, shops and a library.
[citation needed] The prayer hall is arranged around a central courtyard, characterised by six large domes resting on clustered columns.
The women's prayer area, which is surrounded by a screen, is divided into two parts as a passageway connects the northern entrance with the courtyard.
[citation needed] When Quba Mosque was rebuilt in 1986, the Medina architecture was retained – ribbed white domes, and basalt facing and modest exterior – qualities that recalls Madina's simplicity.