Isma'il bin Abd al-Malik, the nephew of Abd al-Aziz bin Rufay' (may Allah have mercy on him), says: I asked Ata bin Abi Rabah (may Allah have mercy on him): "If a child born of fornication falls ill, should I visit him?" He said: "Yes." I said: "If he dies, should I pray the funeral prayer over him?" He said: "Yes." Then I said: "If he gives testimony, is his testimony accepted?" He said: "Yes." I said: "May he lead the prayer?" He said: "Yes."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5135