Which infections are relevant?
Persistent infection with certain types of human papillomavirus (HPV) can contribute to cervical cancer and some other cancers, including cancers affecting the anus and parts of the throat. HPV is common. Most infections do not lead to cancer.
Long-standing hepatitis B or hepatitis C infection can increase the risk of primary liver cancer. This is one reason why the cause and condition of the liver matter when assessing cancer that starts in the liver.
Helicobacter pylori, often shortened to H. pylori, is a bacterium that can live in the stomach. It can increase the risk of stomach cancer and a type of lymphoma affecting the stomach. Most people with the infection do not develop those cancers.
These examples are not a complete list, and the mechanism is not identical for every infection.
Why might an infection matter years later?
Some infections can cause persistent inflammation or changes in infected cells. Cancer usually develops through additional biological changes over time, rather than immediately after an infection.
Knowing that an infection is associated with a cancer does not let us identify every step that caused one person's diagnosis. It should not become a reason for blame or assumptions about their past.
Can this knowledge help prevent cancer?
Yes. Prevention can include vaccination against HPV or hepatitis B, appropriate assessment and treatment of certain infections, and participation in recommended screening programmes. These measures have different roles and eligibility criteria; no one vaccine or test prevents every cancer.
Vaccination is not a treatment for a cancer that has already developed. Your GP or specialist can explain which preventive measures, tests or follow-up are relevant to your history. A diagnosis in someone you know does not, by itself, mean you need infection testing.
For the broader relationship between risk factors and individual diagnoses, see why cancer can occur despite a healthy lifestyle.
General information only. Decisions about vaccination, infection testing or treatment should be made using your own clinical circumstances.