Sunan an-Nasa'i, Book 13, Hadith 10 (Nasa'i 1190)

It was narrated from 'Ammar bin Yasir that:

He greeted the Messenger of Allah (ﷺ) with the Salam when he was praying, and he returned the greeting.