(a) It is narrated from a man of the Ansar that the Prophet (peace and blessings be upon him) said: "When one of you finds a louse or the like during prayer, let him not kill it, but let him hold on to it until he has finished the prayer."
(b) Ali bin Mubarak (may Allah have mercy on him) narrates through Yahya: "Let him keep hold of it, then take it out of the mosque."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3607
It is narrated from a man of the Ansar (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When one of you finds a louse in the mosque, let him keep hold of it until he takes it out of the mosque."
This is a hasan (good) mursal report in a matter such as this.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3608
(a) Rabi' bin Khuthaym (may Allah have mercy on him) narrates that Abdullah bin Mas'ud (may Allah be pleased with him) saw a louse on a man's garment in the mosque, so he took it and buried it in the pebbles, then recited: "Have We not made the earth a receptacle, for the living and the dead?" [Surah al-Mursalat: 25-26]
(b) Something similar is reported from Mujahid and Ibn al-Musayyib (may Allah have mercy on them both): that one should bury it, just like phlegm.
(c) It has been narrated to us on the authority of Malik bin Yakhamir (may Allah have mercy on him): I saw Mu'adh bin Jabal (may Allah be pleased with him); he would kill lice and fleas while in prayer.
(d) Al-Hasan (may Allah have mercy on him) said: There is no harm in killing lice during prayer, but one should not start fidgeting idly.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3609