The study, published in the British Journal of Cancer, found that the more often the drugs are taken, the greater the degree of protection.
A trial involving 300,000 people found that those who took aspirin in the previous 12 months were 36% less likely to develop cancer, while those taking a non-steroidal anti-inflammatory drug (NSAID) such as ibuprofen were 32% less at risk.
Three quarters of the group had taken aspirin and half had taken NSAIDs at least once. A quarter reported daily aspirin use and a tenth took an NSAID at least once a day.
Although no protection against cancer in the top of the stomach or the oesophagus was reported, other published research indicates that protection extends to all types of stomach cancer.
While taking aspirin regularly is know to reduce the risk of bowel cancer, it is not recommended because of side effects, including stomach bleeding.