Short Answer
Animals are living beings and creations of Allah. Killing an animal is forbidden unless it is for a human to benefit from it [by eating it or using it’s body] or for some other good reason. Nonetheless, since an animal is not like a human in free will or moral responsibility, you may end its life if it there is a need such as if it is harming you, or it is injured, sick, or suffering for some other reason.
What the Qur’an and Sunnah Say
The Prophet said, “If someone kills a sparrow for no reason, it will cry out to Allah Most High on the Day of Judgment saying, ‘O Lord! So-and-so killed me in vain, and did not kill me for any useful purpose.’” (Nasa’i #4446, Ibn Hibban #5894, Ahmad 4:489)
The Messenger of Allah cursed those who use any living thing for target practice.” (Muslim #1958)
The Messenger of Allah said, “A woman was punished for imprisoning a cat until it died, and she entered the fire of Hell because of that. She did not feed it or give it water when she imprisoned it, neither did she leave it free to eat of the pests of the earth.” (Muslim #2242)
What the Scholars Said
Imam Kasani said, “It is permitted to hunt land and sea animals, both whose meat is Halal and whose meat is not Halal to eat. Hunting Halal animals would be to benefit from eating their meat, whilst hunting Haram animals would be to benefit from their skin, hair and bones; or to protect one’s self from their harm.” (Bada’i as-Sana’i 5:91)
Imam Ibn Abidin said, “It is permitted to slaughter a cat or dog for some benefit. It is better to slaughter a dog if it is close to death…for in slaughtering the dog, one is relieving it from pain. (Imam) Tahtawi said that this ruling is not restricted to a dog.” (Radd ul-Muhtar 6:474)
A group of scholars said, “If a donkey becomes ill such that one is unable to benefit from it, then there is nothing wrong with slaughtering it to end its suffering.” (Al-Fatawa al-Hindiyya 5:361)
Imam Dasuqi said, “It is permitted to slaughter a donkey or mule if one loses hope in its recovery (when it is sick), actually it is recommended to end its suffering.” (Hashiyat Ad-Dasuqi 2:108)
Version 0.25
Shaykh Mustafa Umar