Oncogenic human papillomavirus (HPV) is a common genital infection that has the potential to develop into cervical cancer in some women. This Review summarises current knowledge on the mechanisms of host immunity that help prevent and control HPV infection and the viral factors that exist to avoid immune surveillance. Although most women clear the infection within a few months, the virus induces a shift towards immune tolerance that can facilitate persistence and permit tumorigenesis. Mechanisms used by HPV to avoid immune surveillance and control include infecting only the basal layer of the cervical epithelium, limiting expression of viral proteins until later stages of epithelial differentiation, undergoing non-lytic replication, and downregulating the expression of important receptors on cells of the innate immune system. Furthermore, HPV suppresses the expression of several proinflammatory proteins that are crucial in clearing infection and activating the cytotoxic T lymphocytes involved in killing virus-infected cells. Interestingly, neutralising antibodies, although of uncertain effectiveness in preventing infection or reinfection after natural exposure (prior infection), are highly protective after immunisation with HPV virus-like-particle-based vaccines. Understanding what is known and unknown about the interaction between the immune system and HPV is important in the assessment of the potential contribution of prophylactic vaccination in reducing the incidence of cervical cancer. However, despite our growing understanding, many aspects of the interactions between HPV and the host immune system remain unknown, and this Review draws attention to several of these unresolved issues and their implications.