As written in Saheeh Muslim book, a Companion of Muhammad PBUH narrated the story as follow:
“We were on a journey and during the Prophet’s absence, we saw a bird with its two chicks; we took them. The mother bird was circling above us in the air, beating its wings in grief. When Prophet Muhammad returned he said, “Who has hurt the feelings of this bird by taking its chicks? Return them to her.”
Read also: King Solomon Talk With an Ant
Muhammad PBUH also prohibited Muslim using life animal for game such as making it as a target for arrows. It is allowed to kill animal just in need of food. We all know that lions in jungle hunt other animals only when they are hungry.
Muhammad PBUH also said, "If someone kills a sparrow for sport, the sparrow will cry out on the Day of Judgment, “O Lord! That person killed me in vain! He did not kill me for any useful purpose." (An Nasai)
Another story about how Muhammad gave an example treating animal in a best way. One day a cat fell asleep on robe of Muhammad PBUH. Muhammad did not disturb that cat, but he cut off his robe and let the cat continue its sleep. My ex-teacher told a different story about this. He told me that the cat fell asleep on the rug where Muhammad usually performs Sholah. Muhammad PBUH who wanted to pray took scissors and cut the rug. Then, he performed Sholah in another place.
Animals are like human, though not completely the same. In Quran God explains:
"And there is no creature on the earth or bird that flies with its wings except that they are communities like you. We have not neglected in the Register a thing. Then unto their Lord they will be gathered." (Al-'An`ām, 38)
"Do you not see that Allah is exalted by whomever is within the heavens and the earth and by the birds with wings spread in flight? Each of them has known his means of prayer and exalting Him, and Allah is Knowing of what they do." (An Nuur, 41)
There are a lot of stories about how to treat animals, but I could not write all stories here. This story has been clear enough for us, for Muslim especially, that we should protect animals from violence.