Praise be to Allah.
Prayer is invalidated if one of three things mentioned by the Prophet (peace and blessings of Allaah be upon him) walks in front of the worshipper. He (peace and blessings of Allaah be upon him) said: “Prayer is invalidated by a woman, a donkey or a dog; that may be prevented by something equal in height to the back of a saddle [placed in front of the worshipper as a sutrah or screen].” (Narrated by Muslim, 511).
According to one report, “a black dog.” The narrator said: “I said, ‘O Abu Dharr, what is the difference between a black dog and a red or yellow dog?’ He said, ‘O son of my brother, I asked the Messenger of Allaah (peace and blessings of Allaah be upon him) the same question, and he said, “The black dog is a devil.”’” (Narrated by Muslim, 510).
This ruling applies if one of the things mentioned passes in front of the worshipper and he does not have a sutrah or object to serve as a screen in front of him. But if he has a screen in front of him and the person or animal passes beyond that sutrah, then his prayer is not affected, because of the hadeeth of Abu Juhayfah who said: “I heard my father narrating that the Prophet (peace and blessings of Allaah be upon him) led them in prayer in al-Bat-ha’, and in front of them was an ‘anzah (a short spear, iron-tipped at its lower end). He prayed two rak’ahs for Zuhr followed by two rak’ahs for ‘Asr, and a woman and a donkey passed in front of him.” (Narrated by al-Bukhaari, 495).
This ruling applies to the imaam and to one who is praying alone; with regard to the members of a congregation praying behind an imaam, the sutrah of the imaam is also a sutrah for them. See question no. 3404.
As for cats, they do not invalidate the prayer even if they pass in front of you, because the basic guideline is that the prayer is valid, and there is no evidence to suggest that cats can invalidate the prayer.
But the worshipper should try hard to ensure that nothing passes in front of him. ‘Amr ibn Shu’ayb narrated from his father that his grandfather said: “We stopped with the Messenger of Allaah (peace and blessings of Allaah be upon him) in Thaniyyat Adhaakhir and the time for prayer came, so he prayed facing a wall which lay in the direction of the qiblah, and we were behind him. A lamb came and tried to pass in front of him and he kept pushing it back until its belly was pushed up against the wall, then it passed behind him.” (narrated by Abu Dawood, 708; al-Albaani said in Saheeh Abi Dawood, it is hasan saheeh, 652).
Question: are cats taahir (pure) or naajis (impure)?
Answer: cats are taahir, and based on that, if a cat drinks from a vessel of water, the vessel does not become impure, because of the hadeeth of Kabshah bint Ka’b ibn Maalik, who was in the house of Abu Qutaadah: “Abu Qutaadah came in and I poured water for him to do wudoo’. A cat came and drank some of the water so he tilted the vessel to let it drink. He saw me looking at him and said, ‘Do you find it strange, O daughter of my brother?’ I said, ‘Yes.’ He said, ‘The Messenger of Allaah (peace and blessings of Allaah be upon him) said that they are not naajis, rather they are among those who go around amongst you.’” Narrated by al-Tirmidhi, 92; classed as saheeh by al-Albaani in Saheeh al-Tirmidhi..