Language:
كتاب الشهادات
52  
Witnesses
(9)
Chapter: Do not be a witness for injustice, if asked for that
(9)
باب لاَ يَشْهَدُ عَلَى شَهَادَةِ جَوْرٍ إِذَا أُشْهِدَ
Sahih al-Bukhari 2652

Narrated `Abdullah:

The Prophet (ﷺ) said, "The people of my generation are the best, then those who follow them, and then whose who follow the latter. After that there will come some people whose witness will go ahead of their oaths, and their oaths will go ahead of their witness." Ibrahim (a sub-narrator) said, "We used to be beaten for taking oaths by saying, 'I bear witness by the Name of Allah or by the Covenant of Allah."

حَدَّثَنَا مُحَمَّدُ بْنُ كَثِيرٍ، أَخْبَرَنَا سُفْيَانُ، عَنْ مَنْصُورٍ، عَنْ إِبْرَاهِيمَ، عَنْ عَبِيدَةَ، عَنْ عَبْدِ اللَّهِ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ خَيْرُ النَّاسِ قَرْنِي، ثُمَّ الَّذِينَ يَلُونَهُمْ، ثُمَّ الَّذِينَ يَلُونَهُمْ، ثُمَّ يَجِيءُ أَقْوَامٌ تَسْبِقُ شَهَادَةُ أَحَدِهِمْ يَمِينَهُ، وَيَمِينُهُ شَهَادَتَهُ ‏"‏‏.‏ قَالَ إِبْرَاهِيمُ وَكَانُوا يَضْرِبُونَنَا عَلَى الشَّهَادَةِ وَالْعَهْدِ‏.‏
Reference : Sahih al-Bukhari 2652
In-book reference : Book 52, Hadith 16
USC-MSA web (English) reference : Vol. 3, Book 48, Hadith 820
  (deprecated numbering scheme)