Sunan Ibn Majah — Establishing the Prayer and the Sunnah Regarding Them — Hadith No: 1018
Translation
It was narrated that Jabir said:“The Prophet (ﷺ) sent me on an errand, then I caught up with him while he was performing prayer, and I greeted him. He gestured to me, then when he finished, he called me and said: ‘You greeted me before, but I was performing prayer.’”