Sunscreen alone should not be relied on to prevent malignant melanoma, a deadly form of skin cancer, research suggests.
The UK study backs public health campaigns calling for sunscreen to be combined with other ways to protect the skin from sun, such as hats and shade.
Animal research, published in Nature, reveals more about how UV light induces cancer in skin cells.
Malignant melanoma is the fifth most common cancer in the UK, with more than 13,000 people diagnosed each year.
Sun exposure is a well-known risk factor for melanoma skin cancer.
But, until now, the molecular mechanism by which UV light damages DNA in skin cells has been unclear.
In the new study, scientists at the University of Manchester looked at the effects of UV light on the skin of mice at risk of melanoma.
This allowed them to examine the effects of sunscreen in blocking the disease.
"UV light targets the very genes protecting us from its own damaging effects, showing how dangerous this cancer-causing agent is," said lead researcher Prof Richard Marais.
"Very importantly, this study provides proof that sunscreen does not offer complete protection from the damaging effects of UV light.
"This work highlights the importance of combining sunscreen with other strategies to protect our skin, including wearing hats and loose fitting clothing, and seeking shade when the sun is at its strongest."
Sun safety habits
The researchers found that UV light caused faults in the p53 gene, which normally helps protect the body from the effects of DNA damage.
The study also showed that sunscreen could reduce the amount of DNA damage caused by UV, delaying the development of melanoma in mice.
But it found sunscreen did not offer complete protection and UV light could still induce melanoma, although at a reduced rate.
Dr Julie Sharp, head of health information at Cancer Research UK, said people tended to think they were "invincible" once they had put on sunscreen and may spend longer in the sun, increasing their overall exposure to UV rays.
"This research adds important evidence showing that sunscreen has a role, but that you shouldn't just rely on this to protect your skin," she said.
"It's essential to get into good sun safety habits, whether at home or abroad, and take care not to burn - sunburn is a clear sign that the DNA in your skin cells has been damaged and, over time, this can lead to skin cancer."
Malignant melanoma has become the fifth most common cancer in the UK, with more than 13,000 people diagnosed with the disease each year.
Prof Nic Jones, director of the Manchester Cancer Research Centre, said: "With the number of cases increasing, we urgently need to understand more about the disease and find new and better treatments."
"This is the first example of a mouse model that absolutely shows that UV light causes melanoma," Prof Marais told BBC News.