Fiqh-us-Sunnah Volume 002, Supererogatory Prayer, Fiqh 2.083.

Section : Killing a snake, scorpion or other harmful animals.

If killing these would only require a small action on the part of the person in salah, then there is no harm in doing it. Abu Hurairah reported that the Prophet sallallahu alehi wasallam said: "Kill the snake and the scorpion during the salah." This is related by Ahmad, at-Tirmizhi, Abu Dawud, an-Nasa'i, and Ibn Majah. The hadith is hasan sahih.

Related Hadith(s)