[Machine] The Prophet (pbuh) and I entered a Jewish synagogue. He said, "O people of Jews, show me twelve men who bear witness that there is no god but Allah and that Muhammad is the Messenger of Allah, and Allah will remove the anger from any Jew that they are beneath the sky." None of them responded to him, so he said, "Have you denied? By Allah, I am the last, the final, and the chosen Prophet. Have you believed in me, or have you rejected me?" Then we left, and as we were about to exit, a man from behind us said, "O Muhammad, just as you are, how do I know you, O people of Jews?" They replied, "By Allah, we do not know of anyone among us who is more knowledgeable of the Book of Allah than you, nor do we know of anyone who understands it better than you, your father before you, or your grandfather before your father." He said, "Indeed, I bear witness for him with Allah that he is the Prophet of Allah whom you find mentioned in the Torah." They said, "You have lied!" Then they accused him of evil. The Messenger of Allah (pbuh) said, "You have lied, and your word will not be accepted. If you praise him when he deserves it, and then deny him when he believes, your word will not be accepted." Then we left, and there were three of us; the Messenger of Allah (pbuh), Abdullah ibn Salam, and myself. Allah revealed in reference to this incident, "Say, 'Have you considered: if it is from Allah and you disbelieved in it?" [Surah Al-Ahqaf: 10]. This hadith is recorded in the collections of Al-Bukhari and Muslim, based on the conditions of both scholars, and they did not exclude it. It is agreed upon that it is a summarized narration from Anas, and Abdullah ibn Salam was mentioned briefly.
انْطَلَقَ النَّبِيُّ ﷺ وَأَنَا مَعَهُ حَتَّى دَخَلْنَا كَنِيسَةَ الْيَهُودِ فَقَالَ «يَا مَعْشَرَ الْيَهُودِ أَرُونِي اثْنَيْ عَشَرَ رَجُلًا يَشْهَدُونَ أَنَّ لَا إِلَهَ إِلَّا اللَّهُ وَأَنَّ مُحَمَّدًا رَسُولُ اللَّهِ يَحُطُّ اللَّهُ عَنْ كُلِّ يَهُودِيٍّ تَحْتَ أَدِيمِ السَّمَاءِ الْغَضَبَ الَّذِي غَضِبَ عَلَيْهِمْ» قَالَ فَأُسْكِتُوا مَا أَجَابَهُ مِنْهُمْ أَحَدٌ ثُمَّ رَدَّ عَلَيْهِمْ فَلَمْ يُجِبْهُ مِنْهُمْ أَحَدٌ فَقَالَ «أَبَيْتُمْ فَوَاللَّهِ لَأَنَا الْحَاشِرُ وَأَنَا الْعَاقِبُ وَأَنَا النَّبِيُّ الْمُصْطَفَى آمَنْتُمْ أَوْ كَذَبْتُمْ» ثُمَّ انْصَرَفَ وَأَنَا مَعَهُ حَتَّى كِدْنَا أَنْ نَخْرُجَ فَإِذَا رَجُلٌ مِنْ خَلْفِنَا يَقُولُ كَمَا أَنْتَ يَا مُحَمَّدُ فَقَالَ ذَلِكَ الرَّجُلُ أَيُّ رَجُلٍ تَعْلِمُونِي فِيكُمْ يَا مَعْشَرَ الْيَهُودِ؟ قَالُوا وَاللَّهِ مَا نَعْلَمُ أَنَّهُ كَانَ فِينَا رَجُلٌ أَعْلَمُ بِكِتَابِ اللَّهِ مِنْكَ وَلَا أَفْقَهُ مِنْكَ وَلَا مِنْ أَبِيكَ قَبْلَكَ وَلَا مِنْ جَدِّكَ قَبْلَ أَبِيكَ قَالَ فَإِنِّي أَشْهَدُ لَهُ بِاللَّهِ أَنَّهُ نَبِيُّ اللَّهِ الَّذِي تَجِدُونَهُ فِي التَّوْرَاةِ فَقَالُوا كَذَبْتَ ثُمَّ رَدُّوا عَلَيْهِ قَوْلَهُ وَقَالُوا فِيهِ شَرًّا فَقَالَ رَسُولُ اللَّهِ ﷺ «كَذَبْتُمْ لَنْ يُقْبَلَ قَوْلُكُمْ أَمَّا آنِفًا فَتُثْنُونَ عَلَيْهِ مِنَ الْخَيْرِ مَا أَثْنَيْتُمْ وَأَمَّا إِذَا آمَنَ فَكَذَّبْتُمُوهُ وَقُلْتُمْ فِيهِ مَا قُلْتُمْ فَلَنْ يُقْبَلَ قَوْلُكُمْ» قَالَ فَخَرَجْنَا وَنَحْنُ ثَلَاثَةٌ رَسُولُ اللَّهِ ﷺ وَأَنَا وَعَبْدُ اللَّهِ بْنُ سَلَّامٍ وَأَنْزَلَ اللَّهُ تَعَالَى فِيهِ {قُلْ أَرَأَيْتُمْ إِنْ كَانَ مِنْ عِنْدِ اللَّهِ وَكَفَرْتُمْ بِهِ} [الأحقاف 10] الْآيَةَ «صَحِيحٌ عَلَى شَرْطِ الشَّيْخَيْنِ وَلَمْ يُخَرِّجَاهُ إِنَّمَا اتَّفَقَا عَلَى حَدِيثِ حُمَيْدٍ عَنْ أَنَسٍ أَيُّ رَجُلٍ عَبْدُ اللَّهِ بْنُ سَلَّامٍ فِيكُمْ مُخْتَصَرًا» على شرط البخاري ومسلم