It was narrated from Ibn`Abbas that the Messenger of Allah (ﷺ) said:
"Whoever has intercourse with a Mahram relative, kill him; and whoever has intercourse with an animal, kill him, and kill the animal." (JA)
English reference (JA): Vol. 3, Book 20, Hadith 2564 (JA)
Arabic reference (JA): Book 20, Hadith 2661 (JA)