The invention concerns novel substituted pyrazolo- and triazolo-pyrimidine compounds of formula (I) having antiviral activity, in particular, having an inhibitory activity on the replication of the respiratory syncytial virus (RSV). The invention further concerns pharmaceutical compositions comprising these compounds and the compounds for use in the treatment of respiratory syncytial virus infection.