Prophet Muhammed (peace be upon him) stayed at Kalthoum ibn Al-Hadmi in Quba for four days (Monday to Thursday)
He built the Quba mosque and prayed in it.
It was the first mosque built on righteous foundations. Allah (Glory be to Him) described this mosque, saying, {The Mosque which has been founded on piety from the very first day, is the proper place for you to stand (for Prayer). For there are such people in it as would like to keep themselves pure; and Allah likes those people who like to keep themselves pure} [Surah At-Tawba: 108].
On the fifth day of his stay at Quba, on Friday, Allah ordered Prophet Muhammed to ride his camel, and Abu Bakr walked beside him. Prophet Muhammed (peace be upon him) reached his uncles from his mother’s side (Bani An-Najjar). They came to him, carrying their swords, and surrounded Prophet Muhammed as he went towards Medina. Prophet Muhammed (peace be upon him) prayed Friday prayer at Bani Salim ibn Auf, in the mosque in the middle of the valley. There were 100 men in the prayer [related by Al-Bukhari].