The exact cause of anal cancer is unknown, although a number of factors can increase your risk of developing the condition. These include: infection with human papilloma virus (HPV) – a common and usually harmless group of viruses spread through sexual contact, which can affect the moist membranes lining your body; having anal sex or lots of sexual partners – possibly because this increases your risk of developing HPV; having a history of cervical, vaginal or vulval cancer; smoking and having a weakened immune system – for example, if you have HIV. Your risk of developing anal cancer increases as you get older, with half of all cases diagnosed in people aged 65 or over. The condition is also slightly more common in women than men.