The Messenger of Allah ﷺ stood for prayer and we stood with him. While in the prayer, an Arabi said, "O Allah, have mercy on me and on Muhammad, and do not extend Your mercy to anyone else along with us."When the Prophet ﷺ finished the prayer, he said to the Arabi, "You have restricted something vast," meaning the mercy of Allah.
قام رسول الله ﷺ في صلاة وقمنا معه، فقال أعرابي وهو في الصلاة: اللهم ارحمني ومحمدا ولا ترحم معنا أحدا. فلما سلم النبي ﷺ قال للأغرابي: لقد حجرت واسعا يريد رحمة الله.
Bukhari reported it in Al-Adab (6010) from Abu Yaman, who said, Shuayb informed us, from Zuhri, who said, Abu Salama bin Abdul-Rahman informed me, that Abu Hurairah said, and he mentioned it.Its full sourcing has already been covered in detail in the chapter on purification, since this is the same Bedouin who urinated in the masjid. As for his saying, "O Allah, have mercy on me and on Muhammad, and do not have mercy on anyone besides us," Suyuti says in his commentary on Nasai, "This is not the kind of thing people normally say. Yes, it is a supplication containing something unbecoming, and it seems this is why it is mentioned here."I say, Nasai classified it as speech occurring during prayer and titled the chapter accordingly, though he holds that this was abrogated, since he mentioned in the same chapter the hadith of Zayd bin Arqam, which explicitly states the abrogation.