Herpesviruses have evolved numerous strategies to subvert host immune responses so they can coexist with their host species. These viruses 'co-opt' host genes for entry into host cells and then express immunomodulatory genes, including mimics of members of the tumour-necrosis factor (TNF) superfamily, that initiate and alter host-cell signalling pathways. TNF superfamily members have crucial roles in controlling herpesvirus infection by mediating the direct killing of infected cells and by enhancing immune responses. Despite these strong immune responses, herpesviruses persist in a latent form, which suggests a dynamic relationship between the host immune system and the virus that results in a balance between host survival and viral control.