Sunan Ibn Majah, Book 33, Hadith 39 (In-Book) ⓘ
It was narrated from Abu Hurairah that: "a man entered the masjid, and the Messenger of Allah was sitting in a corner of the mosque. He prayed, then he came and greeted him with Salam(peace), and he said: 'Wa 'alaikassalm."
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ نُمَيْرٍ، حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ عُمَرَ، حَدَّثَنَا سَعِيدُ بْنُ أَبِي سَعِيدٍ الْمَقْبُرِيُّ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَجُلاً، دَخَلَ الْمَسْجِدَ وَرَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ جَالِسٌ فِي نَاحِيَةِ الْمَسْجِدِ فَصَلَّى ثُمَّ جَاءَ فَسَلَّمَ فَقَالَ " وَعَلَيْكَ السَّلاَمُ " .
also referenced under: Hadith 3695 (Reference) & Volume 5, Book 33, Hadith 3695 (DarusSalam)