‘A'isha said that when God’s messenger intended to engage in private devotion in the mosque he prayed the dawn prayer and then entered his place of seclusion.
Anas said that the Prophet was accustomed to engage in private devotion in the mosque during the last ten nights of Ramadan; but one year he omitted it and he engaged in it during twenty nights the next year.
Tirmidhi transmitted it, and Abu Dawud and Ibn Majah transmitted it from Ubayy b. Ka'b.
She said that the Prophet used to visit the sick while engaged in a period of private devotion in the mosque and he would pass on straight ahead without pausing and ask for him.
Ibn ‘Umar said that when ‘Umar consulted the Prophet about a vow he had made in the pre-Islamic period to spend a night in devotion in the sacred mosque, he said, “Fulfill your vow.”