Mishkat al-Masabih

Jabir said that a man committed fornication with a woman and the Prophet (ﷺ) gave command that he be given the appropriate beating, but on being told afterwards that the man was married he gave command that he should be stoned to death. Abu Dawud transmitted it.

وَعَنْ جَابِرٍ: أَنَّ رَجُلًا زَنَى بِامْرَأَةٍ فَأَمَرَ بِهِ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَجُلِدَ الْحَدَّ ثُمَّ أُخْبِرَ أَنَّهُ مُحْصَنٌ فَأَمَرَ بِهِ فرجم. رَوَاهُ أَبُو دَاوُد