Rilpivirine is a second-generation nonnucleoside reverse-transcriptase inhibitor (NNRTI) currently indicated for first-line therapy, but its clinical benefit for HIV-1 infected patients failing first-generation NNRTIs is largely undefined. This study quantified the extent of genotypic rilpivirine resistance in viral isolates from 1212 patients upon failure of efavirenz- or nevirapine-containing antiretroviral treatment, of whom more than respectively 80% and 90% showed high-level genotypic resistance to the failing NNRTI. Of all study patients, 47% showed a rilpivirine resistance-associated mutation (RPV-RAM), whereas preserved residual rilpivirine activity was predicted in half of the patients by three genotypic drug resistance interpretation algorithms. An NNRTI-dependent impact on rilpivirine resistance was detected. Compared with the use of nevirapine, the use of efavirenz was associated with a 32% lower risk of having a RPV-RAM and a 50% lower risk of predicted reduced rilpivirine susceptibility. Most prevalent RPV-RAMs after nevirapine experience were Y181C and H221Y, whereas L100I+K103N, Y188L and K101E occurred most in efavirenz-experienced patients. Predicted rilpivirine activity was not affected by HIV-1 subtype, although frequency of individual mutations differed across subtypes. In conclusion, this genotypic resistance analysis strongly suggests that the latest NNRTI, rilpivirine, may retain activity in a large proportion of HIV-1 patients in whom resistance failed while they were on an efavirenz- or nevirapine-containing regimen, and may present an attractive option for second-line treatment given its good safety profile and dosing convenience. However, prospective clinical studies assessing the effectiveness of rilpivirine for NNRTI-experienced patients are warranted to validate knowledge derived from genotypic and phenotypic drug resistance studies.