Jami` at-Tirmidhi, Book 20, Hadith 12 (In-Book)

Narrated Ibn 'Umar: That the Messenger of Allah came across 'Umar while he was on his mount, and he was swearing by his father. So the Messenger of Allah said: "Verily Allah prohibits you from swearing by your fathers. So let the one who swears, swear by Allah, or be silent."

حَدَّثَنَا هَنَّادٌ، حَدَّثَنَا عَبْدَةُ، عَنْ عُبَيْدِ اللَّهِ بْنِ عُمَرَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم أَدْرَكَ عُمَرَ وَهُوَ فِي رَكْبٍ وَهُوَ يَحْلِفُ بِأَبِيهِ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِنَّ اللَّهَ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ لِيَحْلِفْ حَالِفٌ بِاللَّهِ أَوْ لِيَسْكُتْ ‏" ‏ ‏.‏ قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ ‏.‏

sunnah.com