Sunan Abi Dawud, Book 40, Hadith 114 (Abu Dawud 4466)

Narrated Abdullah ibn Abbas:

The Prophet (ﷺ) said: If anyone has sexual intercourse with an animal, kill him and kill it along with him. I (Ikrimah) said: I asked him (Ibn Abbas): What offence can be attributed to the animal/ He replied: I think he (the Prophet) disapproved of its flesh being eaten when such a thing had been done to it. Abu Dawud said: This is not a strong tradition.