The Book of Prayers (Kitab Al-Salat)
Muslim :: Book 4 : Hadith 2059
Abu Huraira reported Allah's Apostle (may peace be upon him) as saying: Make haste at a funeral; if the dead person was good, it is a good state to which you are sending him on; but if he was otherwise it is an evil of which you are ridding yourselves.