It is forbidden in Islam to treat an animal cruelly, or to kill it except for the need of food. There are several examples in Hadith where the Prophet Muhammad instructed Muslims to treat animals with kindness and mercy.
“A good deed done to an animal is like a good deed done to a human being,
while an act of cruelty to an animal is as bad as cruelty to a human being."
Allah Rewards You for Showing Mercy to Animals
Abu Umama relates that the Messenger of Allah, Prophet Muhammad (PBUH) said, "Whoever is merciful even to a sparrow, Allah will be merciful to him on the Day of Judgment."