Aspirin and other similar anti-inflammatory painkillers such as ibuprofen and naproxen can lessen the risk of three major types of skin cancer, a new study suggests.

Researchers studied medical records from northern Denmark from 1991 through 2009, finding 3,242 diagnoses of malignant melanoma, the deadliest form of skin cancer, along with 1,974 diagnoses of squamous cell carcinoma, and 13,316 diagnoses of basal cell carcinoma. The study also analyzed prescription data from these patients and information from 178,655 individuals without skin cancer.

Individuals who filled more than two prescriptions for nonsteroidal anti-inflammatory drugs (NSAIDs) had a 15 percent lower risk for developing squamous cell carcinoma and a 13 percent decreased risk for developing malignant melanoma than those who filled two or fewer prescriptions for the medications, especially when the drugs were taken for seven or more years or taken at high intensity.

"We hope that the potential cancer-protective effect of NSAIDs will inspire more research on skin cancer prevention," said study researcher Sigrún Alba Jóhannesdóttir of Aarhus University Hospital in Denmark. "Also, this potential cancer-protective effect should be taken into account when discussing benefits and harms of NSAID use."

People who took NSAIDs did not seem to benefit from a reduced risk of developing basal cell carcinoma in general, although they did have a 15 percent and 21 percent reduced risk of developing this type of cancer on less-exposed sites (body areas other than the head and neck) when they took them long term or at high intensity, respectively.

The results are detailed in Cancer, a journal of the American Cancer Society.