The Messenger of Allah (ﷺ) saw people at the end of the mosque, and then the (above-mentioned hadith) was narrated.
Sahih Muslim Book 4, Hadith 145