A federal judge on Thursday handed singer R. Kelly a 20-year prison sentence for his convictions of child pornography and the enticement of minors for sex but said he will serve nearly all of the sentence simultaneously with a 30-year sentence imposed last year on racketeering charges.