Muhammad spent 14 days in this mosque praying "qaṣr" (, a short prayer) while waiting for Ali to arrive in Medina, after the latter stayed behind in Mecca to carry out a couple of tasks entrusted to him by the Prophet.